From 5c9a17732bf07b2de850bd03e64c1dfa4030a50f Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 18 Feb 2015 23:17:51 +0000 Subject: IR: Allow MDSubrange to have 'count: -1' It turns out that `count: -1` is a special value indicating an empty array, such as `Values` in: struct T { unsigned Count; int Values[]; }; Handle it. llvm-svn: 229769 --- llvm/test/Assembler/invalid-mdsubrange-count-negative.ll | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'llvm/test/Assembler/invalid-mdsubrange-count-negative.ll') diff --git a/llvm/test/Assembler/invalid-mdsubrange-count-negative.ll b/llvm/test/Assembler/invalid-mdsubrange-count-negative.ll index 99cc8876750..92c0b4e7ca4 100644 --- a/llvm/test/Assembler/invalid-mdsubrange-count-negative.ll +++ b/llvm/test/Assembler/invalid-mdsubrange-count-negative.ll @@ -1,4 +1,7 @@ ; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s -; CHECK: [[@LINE+1]]:25: error: expected unsigned integer -!0 = !MDSubrange(count: -3) +; CHECK-NOT: error +!0 = !MDSubrange(count: -1) + +; CHECK: :[[@LINE+1]]:25: error: value for 'count' too small, limit is -1 +!0 = !MDSubrange(count: -2) -- cgit v1.2.3