summaryrefslogtreecommitdiffstats
path: root/test/Verifier
diff options
context:
space:
mode:
Diffstat (limited to 'test/Verifier')
-rw-r--r--test/Verifier/2002-04-13-RetTypes.ll4
-rw-r--r--test/Verifier/2002-11-05-GetelementptrPointers.ll2
-rw-r--r--test/Verifier/2006-07-11-StoreStruct.ll2
-rw-r--r--test/Verifier/2006-10-15-AddrLabel.ll3
-rw-r--r--test/Verifier/2006-12-12-IntrinsicDefine.ll2
-rw-r--r--test/Verifier/2008-03-01-AllocaSized.ll2
-rw-r--r--test/Verifier/2008-08-22-MemCpyAlignment.ll6
-rw-r--r--test/Verifier/2008-11-15-RetVoid.ll2
-rw-r--r--test/Verifier/2010-08-07-PointerIntrinsic.ll2
-rw-r--r--test/Verifier/AmbiguousPhi.ll2
-rw-r--r--test/Verifier/PhiGrouping.ll2
-rw-r--r--test/Verifier/SelfReferential.ll2
-rw-r--r--test/Verifier/aliasing-chain.ll2
-rw-r--r--test/Verifier/cttz-undef-arg.ll2
-rw-r--r--test/Verifier/dominates.ll57
-rw-r--r--test/Verifier/fpmath.ll2
-rw-r--r--test/Verifier/invoke-1.ll10
-rw-r--r--test/Verifier/invoke-2.ll14
-rw-r--r--test/Verifier/invoke.ll80
-rw-r--r--test/Verifier/range-1.ll66
-rw-r--r--test/Verifier/range-2.ll14
21 files changed, 235 insertions, 43 deletions
diff --git a/test/Verifier/2002-04-13-RetTypes.ll b/test/Verifier/2002-04-13-RetTypes.ll
index 4c1ddd1..af46839 100644
--- a/test/Verifier/2002-04-13-RetTypes.ll
+++ b/test/Verifier/2002-04-13-RetTypes.ll
@@ -1,6 +1,6 @@
-; RUN: not llvm-as < %s |& grep {value doesn't match function result type 'i32'}
+; RUN: not llvm-as < %s 2>&1 | grep "value doesn't match function result type 'i32'"
-; Verify the the operand type of the ret instructions in a function match the
+; Verify the operand type of the ret instructions in a function match the
; delcared return type of the function they live in.
;
diff --git a/test/Verifier/2002-11-05-GetelementptrPointers.ll b/test/Verifier/2002-11-05-GetelementptrPointers.ll
index 1f71387..108ae5f 100644
--- a/test/Verifier/2002-11-05-GetelementptrPointers.ll
+++ b/test/Verifier/2002-11-05-GetelementptrPointers.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s |& grep {invalid getelementptr indices}
+; RUN: not llvm-as < %s 2>&1 | grep "invalid getelementptr indices"
; This testcase is invalid because we are indexing into a pointer that is
; contained WITHIN a structure.
diff --git a/test/Verifier/2006-07-11-StoreStruct.ll b/test/Verifier/2006-07-11-StoreStruct.ll
index 80ab122..65b229d 100644
--- a/test/Verifier/2006-07-11-StoreStruct.ll
+++ b/test/Verifier/2006-07-11-StoreStruct.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s |& not grep {Instruction operands must be first-class}
+; RUN: llvm-as < %s 2>&1 | not grep "Instruction operands must be first-class"
; This previously was for PR826, but structs are now first-class so
; the following is now valid.
diff --git a/test/Verifier/2006-10-15-AddrLabel.ll b/test/Verifier/2006-10-15-AddrLabel.ll
index 0b73b47..c8fedb5 100644
--- a/test/Verifier/2006-10-15-AddrLabel.ll
+++ b/test/Verifier/2006-10-15-AddrLabel.ll
@@ -1,4 +1,5 @@
-; RUN: not llvm-as < %s > /dev/null |& grep {basic block pointers are invalid}
+; RUN: not llvm-as < %s > /dev/null 2> %t
+; RUN: grep "basic block pointers are invalid" %t
define i32 @main() {
%foo = call i8* %llvm.stacksave()
diff --git a/test/Verifier/2006-12-12-IntrinsicDefine.ll b/test/Verifier/2006-12-12-IntrinsicDefine.ll
index 8d09b51..6e7468c 100644
--- a/test/Verifier/2006-12-12-IntrinsicDefine.ll
+++ b/test/Verifier/2006-12-12-IntrinsicDefine.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s |& grep {llvm intrinsics cannot be defined}
+; RUN: not llvm-as < %s 2>&1 | grep "llvm intrinsics cannot be defined"
; PR1047
define void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) {
diff --git a/test/Verifier/2008-03-01-AllocaSized.ll b/test/Verifier/2008-03-01-AllocaSized.ll
index 079a75d..51258be 100644
--- a/test/Verifier/2008-03-01-AllocaSized.ll
+++ b/test/Verifier/2008-03-01-AllocaSized.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as %s -o /dev/null |& grep {Cannot allocate unsized type}
+; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "Cannot allocate unsized type"
; PR2113
define void @test() {
diff --git a/test/Verifier/2008-08-22-MemCpyAlignment.ll b/test/Verifier/2008-08-22-MemCpyAlignment.ll
index aaf69ae..c6d5afd 100644
--- a/test/Verifier/2008-08-22-MemCpyAlignment.ll
+++ b/test/Verifier/2008-08-22-MemCpyAlignment.ll
@@ -1,11 +1,11 @@
-; RUN: not llvm-as %s -o /dev/null |& grep {alignment argument of memory intrinsics must be a constant int}
+; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "alignment argument of memory intrinsics must be a constant int"
; PR2318
define void @x(i8* %a, i8* %src, i64 %len, i32 %align) nounwind {
entry:
- tail call void @llvm.memcpy.i64( i8* %a, i8* %src, i64 %len, i32 %align) nounwind
+ tail call void @llvm.memcpy.p0i8.p0i8.i64( i8* %a, i8* %src, i64 %len, i32 %align, i1 false) nounwind
ret void
}
-declare void @llvm.memcpy.i64( i8* %a, i8* %src, i64 %len, i32)
+declare void @llvm.memcpy.p0i8.p0i8.i64( i8* %a, i8* %src, i64 %len, i32, i1)
diff --git a/test/Verifier/2008-11-15-RetVoid.ll b/test/Verifier/2008-11-15-RetVoid.ll
index aaef703..42503fa 100644
--- a/test/Verifier/2008-11-15-RetVoid.ll
+++ b/test/Verifier/2008-11-15-RetVoid.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s |& grep {value doesn't match function result type 'void'}
+; RUN: not llvm-as < %s 2>&1 | grep "value doesn't match function result type 'void'"
define void @foo() {
ret i32 0
diff --git a/test/Verifier/2010-08-07-PointerIntrinsic.ll b/test/Verifier/2010-08-07-PointerIntrinsic.ll
index bf5563d..3136c61 100644
--- a/test/Verifier/2010-08-07-PointerIntrinsic.ll
+++ b/test/Verifier/2010-08-07-PointerIntrinsic.ll
@@ -1,5 +1,5 @@
; RUN: not llvm-as < %s 2> %t
-; RUN: grep {Broken module} %t
+; RUN: grep "Broken module" %t
; PR7316
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32"
diff --git a/test/Verifier/AmbiguousPhi.ll b/test/Verifier/AmbiguousPhi.ll
index 9a72530..f31bc10 100644
--- a/test/Verifier/AmbiguousPhi.ll
+++ b/test/Verifier/AmbiguousPhi.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s |& grep {multiple entries for the same basic block}
+; RUN: not llvm-as < %s 2>&1 | grep "multiple entries for the same basic block"
diff --git a/test/Verifier/PhiGrouping.ll b/test/Verifier/PhiGrouping.ll
index dc529dc..7b42fd2 100644
--- a/test/Verifier/PhiGrouping.ll
+++ b/test/Verifier/PhiGrouping.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s |& grep {PHI nodes not grouped at top}
+; RUN: not llvm-as < %s 2>&1 | grep "PHI nodes not grouped at top"
diff --git a/test/Verifier/SelfReferential.ll b/test/Verifier/SelfReferential.ll
index 70154b7..c24c0eb 100644
--- a/test/Verifier/SelfReferential.ll
+++ b/test/Verifier/SelfReferential.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as %s -o /dev/null |& grep {Only PHI nodes may reference their own value}
+; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "Only PHI nodes may reference their own value"
; Test that self referential instructions are not allowed
diff --git a/test/Verifier/aliasing-chain.ll b/test/Verifier/aliasing-chain.ll
index fc5ef1c..a52e796 100644
--- a/test/Verifier/aliasing-chain.ll
+++ b/test/Verifier/aliasing-chain.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as %s -o /dev/null |& grep {Aliasing chain should end with function or global variable}
+; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "Aliasing chain should end with function or global variable"
; Test that alising chain does not create a cycle
diff --git a/test/Verifier/cttz-undef-arg.ll b/test/Verifier/cttz-undef-arg.ll
index 48cd061..66c5396 100644
--- a/test/Verifier/cttz-undef-arg.ll
+++ b/test/Verifier/cttz-undef-arg.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s -o /dev/null |& FileCheck %s
+; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
declare i32 @llvm.ctlz.i32(i32, i1)
declare i32 @llvm.cttz.i32(i32, i1)
diff --git a/test/Verifier/dominates.ll b/test/Verifier/dominates.ll
new file mode 100644
index 0000000..17e2c33
--- /dev/null
+++ b/test/Verifier/dominates.ll
@@ -0,0 +1,57 @@
+; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
+
+define i32 @f1(i32 %x) {
+ %y = add i32 %z, 1
+ %z = add i32 %x, 1
+ ret i32 %y
+; CHECK: Instruction does not dominate all uses!
+; CHECK-NEXT: %z = add i32 %x, 1
+; CHECK-NEXT: %y = add i32 %z, 1
+}
+
+declare i32 @g()
+define void @f2(i32 %x) {
+bb0:
+ %y1 = invoke i32 @g() to label %bb1 unwind label %bb2
+bb1:
+ ret void
+bb2:
+ %y2 = phi i32 [%y1, %bb0]
+ %y3 = landingpad i32 personality i32 ()* @g
+ cleanup
+ ret void
+; CHECK: Instruction does not dominate all uses!
+; CHECK-NEXT: %y1 = invoke i32 @g()
+; CHECK-NEXT: to label %bb1 unwind label %bb2
+; CHECK-NEXT: %y2 = phi i32 [ %y1, %bb0 ]
+}
+
+define void @f3(i32 %x) {
+bb0:
+ %y1 = invoke i32 @g() to label %bb1 unwind label %bb2
+bb1:
+ ret void
+bb2:
+ %y2 = landingpad i32 personality i32 ()* @g
+ cleanup
+ br label %bb3
+bb3:
+ %y3 = phi i32 [%y1, %bb2]
+ ret void
+; CHECK: Instruction does not dominate all uses!
+; CHECK-NEXT: %y1 = invoke i32 @g()
+; CHECK-NEXT: to label %bb1 unwind label %bb2
+; CHECK-NEXT: %y3 = phi i32 [ %y1, %bb2 ]
+}
+
+define void @f4(i32 %x) {
+bb0:
+ br label %bb1
+bb1:
+ %y3 = phi i32 [%y1, %bb0]
+ %y1 = add i32 %x, 1
+ ret void
+; CHECK: Instruction does not dominate all uses!
+; CHECK-NEXT: %y1 = add i32 %x, 1
+; CHECK-NEXT: %y3 = phi i32 [ %y1, %bb0 ]
+}
diff --git a/test/Verifier/fpmath.ll b/test/Verifier/fpmath.ll
index b764a63..7002c5c 100644
--- a/test/Verifier/fpmath.ll
+++ b/test/Verifier/fpmath.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s |& FileCheck %s
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
define void @fpmath1(i32 %i, float %f, <2 x float> %g) {
%s = add i32 %i, %i, !fpmath !0
diff --git a/test/Verifier/invoke-1.ll b/test/Verifier/invoke-1.ll
deleted file mode 100644
index 427abe0..0000000
--- a/test/Verifier/invoke-1.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: not llvm-as < %s |& grep {not verify as correct}
-; PR1042
-
-define i32 @foo() {
- %A = invoke i32 @foo( )
- to label %L unwind label %L ; <i32> [#uses=1]
-L: ; preds = %0, %0
- ret i32 %A
-}
-
diff --git a/test/Verifier/invoke-2.ll b/test/Verifier/invoke-2.ll
deleted file mode 100644
index 0145935..0000000
--- a/test/Verifier/invoke-2.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; RUN: not llvm-as %s |& grep {not verify as correct}
-; PR1042
-
-define i32 @foo() {
- br i1 false, label %L1, label %L2
-L1: ; preds = %0
- %A = invoke i32 @foo( )
- to label %L unwind label %L ; <i32> [#uses=1]
-L2: ; preds = %0
- br label %L
-L: ; preds = %L2, %L1, %L1
- ret i32 %A
-}
-
diff --git a/test/Verifier/invoke.ll b/test/Verifier/invoke.ll
new file mode 100644
index 0000000..a48f9b6
--- /dev/null
+++ b/test/Verifier/invoke.ll
@@ -0,0 +1,80 @@
+; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
+
+; PR1042
+define i32 @foo() {
+; CHECK: The unwind destination does not have a landingpad instruction
+ %A = invoke i32 @foo( )
+ to label %L unwind label %L ; <i32> [#uses=1]
+L: ; preds = %0, %0
+ ret i32 %A
+}
+
+; PR1042
+define i32 @bar() {
+ br i1 false, label %L1, label %L2
+L1: ; preds = %0
+ %A = invoke i32 @bar( )
+ to label %L unwind label %L ; <i32> [#uses=1]
+L2: ; preds = %0
+ br label %L
+L: ; preds = %L2, %L1, %L1
+; CHECK: The unwind destination does not have a landingpad instruction
+; CHECK: Instruction does not dominate all uses
+ ret i32 %A
+}
+
+
+declare i32 @__gxx_personality_v0(...)
+declare void @llvm.donothing()
+declare void @llvm.trap()
+declare i8 @llvm.expect.i8(i8,i8)
+declare i32 @fn(i8 (i8, i8)*)
+
+define void @f1() {
+entry:
+; OK
+ invoke void @llvm.donothing()
+ to label %conta unwind label %contb
+
+conta:
+ ret void
+
+contb:
+ %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [0 x i8*] zeroinitializer
+ ret void
+}
+
+define i8 @f2() {
+entry:
+; CHECK: Cannot invoke an intrinsinc other than donothing
+ invoke void @llvm.trap()
+ to label %cont unwind label %lpad
+
+cont:
+ ret i8 3
+
+lpad:
+ %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [0 x i8*] zeroinitializer
+ ret i8 2
+}
+
+define i32 @f3() {
+entry:
+; CHECK: Cannot take the address of an intrinsic
+ %call = call i32 @fn(i8 (i8, i8)* @llvm.expect.i8)
+ ret i32 %call
+}
+
+define void @f4() {
+entry:
+ invoke void @llvm.donothing()
+ to label %cont unwind label %cont
+
+cont:
+; CHECK: Block containing LandingPadInst must be jumped to only by the unwind edge of an invoke.
+ %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [0 x i8*] zeroinitializer
+ ret void
+}
diff --git a/test/Verifier/range-1.ll b/test/Verifier/range-1.ll
index 611933a..b6a75d1 100644
--- a/test/Verifier/range-1.ll
+++ b/test/Verifier/range-1.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s -o /dev/null |& FileCheck %s
+; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
define void @f1(i8* %x) {
entry:
@@ -76,3 +76,67 @@ entry:
}
!8 = metadata !{i8 0, i8 0}
; CHECK: Range must not be empty!
+
+define i8 @f10(i8* %x) {
+entry:
+ %y = load i8* %x, align 1, !range !9
+ ret i8 %y
+}
+!9 = metadata !{i8 0, i8 2, i8 1, i8 3}
+; CHECK: Intervals are overlapping
+
+define i8 @f11(i8* %x) {
+entry:
+ %y = load i8* %x, align 1, !range !10
+ ret i8 %y
+}
+!10 = metadata !{i8 0, i8 2, i8 2, i8 3}
+; CHECK: Intervals are contiguous
+
+define i8 @f12(i8* %x) {
+entry:
+ %y = load i8* %x, align 1, !range !11
+ ret i8 %y
+}
+!11 = metadata !{i8 1, i8 2, i8 -1, i8 0}
+; CHECK: Intervals are not in order
+
+define i8 @f13(i8* %x) {
+entry:
+ %y = load i8* %x, align 1, !range !12
+ ret i8 %y
+}
+!12 = metadata !{i8 1, i8 3, i8 5, i8 1}
+; CHECK: Intervals are contiguous
+
+define i8 @f14(i8* %x) {
+entry:
+ %y = load i8* %x, align 1, !range !13
+ ret i8 %y
+}
+!13 = metadata !{i8 1, i8 3, i8 5, i8 2}
+; CHECK: Intervals are overlapping
+
+define i8 @f15(i8* %x) {
+entry:
+ %y = load i8* %x, align 1, !range !14
+ ret i8 %y
+}
+!14 = metadata !{i8 10, i8 1, i8 12, i8 13}
+; CHECK: Intervals are overlapping
+
+define i8 @f16(i8* %x) {
+entry:
+ %y = load i8* %x, align 1, !range !16
+ ret i8 %y
+}
+!16 = metadata !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 2}
+; CHECK: Intervals are overlapping
+
+define i8 @f17(i8* %x) {
+entry:
+ %y = load i8* %x, align 1, !range !17
+ ret i8 %y
+}
+!17 = metadata !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 1}
+; CHECK: Intervals are contiguous
diff --git a/test/Verifier/range-2.ll b/test/Verifier/range-2.ll
index ef542c8..8d85d19 100644
--- a/test/Verifier/range-2.ll
+++ b/test/Verifier/range-2.ll
@@ -20,3 +20,17 @@ entry:
ret i8 %y
}
!2 = metadata !{i8 1, i8 3, i8 5, i8 42}
+
+define i8 @f4(i8* %x) {
+entry:
+ %y = load i8* %x, align 1, !range !3
+ ret i8 %y
+}
+!3 = metadata !{i8 -1, i8 0, i8 1, i8 2}
+
+define i8 @f5(i8* %x) {
+entry:
+ %y = load i8* %x, align 1, !range !4
+ ret i8 %y
+}
+!4 = metadata !{i8 -1, i8 0, i8 1, i8 -2}
OpenPOWER on IntegriCloud