FileCheckize these testcases.
authorBill Wendling <isanbard@gmail.com>
Sun, 8 Apr 2012 11:00:38 +0000 (11:00 +0000)
committerBill Wendling <isanbard@gmail.com>
Sun, 8 Apr 2012 11:00:38 +0000 (11:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154281 91177308-0d34-0410-b5e6-96231b3b80d8

15 files changed:
test/Assembler/aggregate-constant-values.ll
test/Assembler/bcwrap.ll
test/Assembler/extractvalue-invalid-idx.ll
test/Assembler/getelementptr_struct.ll
test/Assembler/huge-array.ll
test/Assembler/insertextractvalue.ll
test/Assembler/insertvalue-invalid-idx.ll
test/Assembler/invalid_cast.ll
test/Assembler/invalid_cast2.ll
test/Assembler/metadata.ll
test/Assembler/vbool-cmp.ll
test/Assembler/vector-cmp.ll
test/Assembler/vector-select.ll
test/Assembler/vector-shift.ll
test/Bitcode/null-type.ll

index a37d03ebb3875038aff5bf9841144778184523e5..d0aab81a4d680b5e27c0a67e25f311c8ced54015 100644 (file)
@@ -1,25 +1,48 @@
-; RUN: llvm-as < %s | llvm-dis | grep 7 | count 3
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
 
+; CHECK: @foo
+; CHECK: store { i32, i32 } { i32 7, i32 9 }, { i32, i32 }* %x
+; CHECK: ret
 define void @foo({i32, i32}* %x) nounwind {
   store {i32, i32}{i32 7, i32 9}, {i32, i32}* %x
   ret void
 }
+
+; CHECK: @foo_empty
+; CHECK: store {} zeroinitializer, {}* %x
+; CHECK: ret
 define void @foo_empty({}* %x) nounwind {
   store {}{}, {}* %x
   ret void
 }
+
+; CHECK: @bar
+; CHECK: store [2 x i32] [i32 7, i32 9], [2 x i32]* %x
+; CHECK: ret
 define void @bar([2 x i32]* %x) nounwind {
   store [2 x i32][i32 7, i32 9], [2 x i32]* %x
   ret void
 }
+
+; CHECK: @bar_empty
+; CHECK: store [0 x i32] undef, [0 x i32]* %x
+; CHECK: ret
 define void @bar_empty([0 x i32]* %x) nounwind {
   store [0 x i32][], [0 x i32]* %x
   ret void
 }
+
+; CHECK: @qux
+; CHECK: store <{ i32, i32 }> <{ i32 7, i32 9 }>, <{ i32, i32 }>* %x
+; CHECK: ret
 define void @qux(<{i32, i32}>* %x) nounwind {
   store <{i32, i32}><{i32 7, i32 9}>, <{i32, i32}>* %x
   ret void
 }
+
+; CHECK: @qux_empty
+; CHECK: store <{}> zeroinitializer, <{}>* %x
+; CHECK: ret
 define void @qux_empty(<{}>* %x) nounwind {
   store <{}><{}>, <{}>* %x
   ret void
index 859dc4bc80f91d9d05c994e2473a35c64d151b35..4bec48cf63baf1b5b84d12df6cbf84949338be5f 100644 (file)
@@ -1,9 +1,11 @@
 ; RUN: llvm-as < %s > %t
-; RUN: llvm-nm %t | grep foo
-; test for isBitcodeFile, llvm-nm must read from a file for this test
+; RUN: llvm-nm %t | FileCheck %s
+; Test for isBitcodeFile, llvm-nm must read from a file for this test.
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
 target triple = "i686-apple-darwin9.2.2"
 
+; CHECK: foo
+
 define i32 @foo() {
   ret i32 0
 }
index f9644eadbd59f4872e4e5a59b67fcead36eaf7d7..9a215f7194181595397c01bbbb1cbaf224e1cd2e 100644 (file)
@@ -1,6 +1,8 @@
-; RUN: not llvm-as < %s |& grep {invalid indices for extractvalue}
+; RUN: not llvm-as < %s |& FileCheck %s
 ; PR4170
 
+; CHECK: invalid indices for extractvalue
+
 define void @test() {
 entry:
         extractvalue [0 x i32] undef, 0
index c8779a64077c686859967675306d75f4a3182e93..bfebf29bd5eac25dc70c1af5534b37f9da594f99 100644 (file)
@@ -1,6 +1,8 @@
-; RUN: not llvm-as < %s >/dev/null |& grep {invalid getelementptr indices}
+; RUN: not llvm-as < %s >/dev/null |& FileCheck %s
 ; Test the case of a incorrect indices type into struct
 
+; CHECK: invalid getelementptr indices
+
 %RT = type { i8 , [10 x [20 x i32]], i8  }
 %ST = type { i32, double, %RT }
 
index e080947b9945379d7f627df40769029d425d1c09..a1abf879710f44834f7ce4398e852eeafbdb8255 100644 (file)
@@ -1,5 +1,7 @@
-; RUN: llvm-as < %s | llvm-dis | grep 18446744073709551615 | count 2
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
 
+; CHECK: define [18446744073709551615 x i8]* @foo() {
+; CHECK: ret [18446744073709551615 x i8]* null
 define [18446744073709551615 x i8]* @foo() {
   ret [18446744073709551615 x i8]* null
 }
index 2f5521fba87254e5ec374642aac83992aba5adcb..88e4855bec645dd83f91a3aeda3c8ac65bb2662a 100644 (file)
@@ -1,7 +1,13 @@
-; RUN: llvm-as < %s | llvm-dis > %t
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
 ; RUN: grep insertvalue %t | count 1
 ; RUN: grep extractvalue %t | count 1
 
+; CHECK:      @foo
+; CHECK-NEXT: load
+; CHECK-NEXT: extractvalue
+; CHECK-NEXT: insertvalue
+; CHECK-NEXT: store
+; CHECK-NEXT: ret
 define float @foo({{i32},{float, double}}* %p) nounwind {
   %t = load {{i32},{float, double}}* %p
   %s = extractvalue {{i32},{float, double}} %t, 1, 0
@@ -9,21 +15,34 @@ define float @foo({{i32},{float, double}}* %p) nounwind {
   store {{i32},{float, double}} %r, {{i32},{float, double}}* %p
   ret float %s
 }
+
+; CHECK:      @bar
+; CHECK-NEXT: store { { i32 }, { float, double } } { { i32 } { i32 4 }, { float, double } { float 4.000000e+00, double 2.000000e+01 } }, { { i32 }, { float, double } }* %p
+; CHECK-NEXT: ret float 7.000000e+00
 define float @bar({{i32},{float, double}}* %p) nounwind {
   store {{i32},{float, double}} insertvalue ({{i32},{float, double}}{{i32}{i32 4},{float, double}{float 4.0, double 5.0}}, double 20.0, 1, 1), {{i32},{float, double}}* %p
   ret float extractvalue ({{i32},{float, double}}{{i32}{i32 3},{float, double}{float 7.0, double 9.0}}, 1, 0)
 }
+
+; CHECK:      @car
+; CHECK-NEXT: store { { i32 }, { float, double } } { { i32 } undef, { float, double } { float undef, double 2.000000e+01 } }, { { i32 }, { float, double } }* %p
+; CHECK-NEXT: ret float undef
 define float @car({{i32},{float, double}}* %p) nounwind {
   store {{i32},{float, double}} insertvalue ({{i32},{float, double}} undef, double 20.0, 1, 1), {{i32},{float, double}}* %p
   ret float extractvalue ({{i32},{float, double}} undef, 1, 0)
 }
+
+; CHECK:      @dar
+; CHECK-NEXT: store { { i32 }, { float, double } } { { i32 } zeroinitializer, { float, double } { float 0.000000e+00, double 2.000000e+01 } }, { { i32 }, { float, double } }* %p
+; CHECK-NEXT: ret float 0.000000e+00
 define float @dar({{i32},{float, double}}* %p) nounwind {
   store {{i32},{float, double}} insertvalue ({{i32},{float, double}} zeroinitializer, double 20.0, 1, 1), {{i32},{float, double}}* %p
   ret float extractvalue ({{i32},{float, double}} zeroinitializer, 1, 0)
 }
 
-
 ; PR4963
+; CHECK:      @test57
+; CHECK-NEXT: ret <{ i32, i32 }> <{ i32 0, i32 4 }>
 define <{ i32, i32 }> @test57() {
   ret <{ i32, i32 }> insertvalue (<{ i32, i32 }> zeroinitializer, i32 4, 1)
 }
index 86e7258cc5937ad5b0da30b99cf97fafe55b4e35..355d4e8c10fdbc0b29a06aef358d270137b0cfe4 100644 (file)
@@ -1,7 +1,9 @@
-; RUN: not llvm-as < %s |& grep {invalid indices for insertvalue}
+; RUN: not llvm-as < %s |& FileCheck %s
+
+; CHECK: invalid indices for insertvalue
 
 define void @test() {
 entry:
-        insertvalue [0 x i32] undef, i32 0, 0
-        ret void
+  insertvalue [0 x i32] undef, i32 0, 0
+  ret void
 }
index c5b082b6b8d628248df868ac7412c5838a1fac04..f6828357243629664245568a19533e121c1b03f8 100644 (file)
@@ -1,4 +1,6 @@
-; RUN: not llvm-as < %s |& grep {invalid cast opcode}
+; RUN: not llvm-as < %s |& FileCheck %s
+
+; CHECK: invalid cast opcode for cast from '<4 x i64>' to '<3 x i8>'
 
 define <3 x i8> @foo(<4 x i64> %x) {
   %y = trunc <4 x i64> %x to <3 x i8>
index f2e7c414e7106f668cd72d517074afda09a90d9b..a01b935629f56d28325bf3deafc24e93135fd119 100644 (file)
@@ -1,4 +1,6 @@
-; RUN: not llvm-as < %s |& grep {invalid cast opcode}
+; RUN: not llvm-as < %s |& FileCheck %s
+
+; CHECK: invalid cast opcode for cast from '<4 x i64>' to 'i8'
 
 define i8 @foo(<4 x i64> %x) {
   %y = trunc <4 x i64> %x to i8
index 50f27b4eb45fef1419cad2bf3cd337c1e0739969..56888fd70347e7b47191b0c090c4f90d73f6ca5a 100644 (file)
@@ -1,12 +1,12 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep {ret void, !bar !1, !foo !0}
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+
+; CHECK: @test
+; CHECK: ret void, !bar !1, !foo !0
 define void @test() {
   add i32 2, 1, !bar !0
   add i32 1, 2, !foo !1
-  
   call void @llvm.dbg.func.start(metadata !"foo")
-  
   extractvalue {{i32, i32}, i32} undef, 0, 1, !foo !0
-  
   ret void, !foo !0, !bar !1
 }
 
@@ -15,8 +15,5 @@ define void @test() {
 
 declare void @llvm.dbg.func.start(metadata) nounwind readnone
 
-
 !foo = !{ !0 }
 !bar = !{ !1 }
-
-; !foo = !{ !0, !"foo" }
index ac8fb29362f7e6b4c7c83a29bb7b7adb42b2de2a..e652d2ff3b36e775ec6ec3aed60d48f165ea1c04 100644 (file)
@@ -1,15 +1,18 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep {icmp slt}
-; rudimentary test of fcmp/icmp on vectors returning vector of bool
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; Rudimentary test of fcmp/icmp on vectors returning vector of bool
 
+; CHECK: @ffoo
+; CHECK: fcmp olt <4 x float> %a, %b
 define <4 x i1> @ffoo(<4 x float> %a, <4 x float> %b) nounwind {
 entry:
-       %cmp = fcmp olt <4 x float> %a, %b              ; <4 x i1> [#uses=1]
-       ret <4 x i1> %cmp
+  %cmp = fcmp olt <4 x float> %a, %b           ; <4 x i1> [#uses=1]
+  ret <4 x i1> %cmp
 }
 
+; CHECK: @ifoo
+; CHECK: icmp slt <4 x i32> %a, %b
 define <4 x i1> @ifoo(<4 x i32> %a, <4 x i32> %b) nounwind {
 entry:
-       %cmp = icmp slt <4 x i32> %a, %b                ; <4 x i1> [#uses=1]
-       ret <4 x i1> %cmp
+  %cmp = icmp slt <4 x i32> %a, %b             ; <4 x i1> [#uses=1]
+  ret <4 x i1> %cmp
 }
-
index 688369bb62b4907ccd0f40733526bc010fa25140..6e3894ca10075e359d53544713b5f24e6dceaad1 100644 (file)
@@ -1,16 +1,16 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep {global.*icmp slt}
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
 ; PR2317
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
 target triple = "i686-apple-darwin9.2.2"
 
+; CHECK: @1 = global <4 x i1> <i1 icmp slt (i32 ptrtoint (i32* @B to i32), i32 1), i1 true, i1 false, i1 true>
+
 define <4 x i1> @foo(<4 x float> %a, <4 x float> %b) nounwind  {
 entry:
-       %cmp = fcmp olt <4 x float> %a, %b              ; <4 x i32> [#uses=1]
-       ret <4 x i1> %cmp
+  %cmp = fcmp olt <4 x float> %a, %b           ; <4 x i32> [#uses=1]
+  ret <4 x i1> %cmp
 }
 
 global <4 x i1> icmp slt ( <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>  <i32 1, i32 2, i32 1, i32 2> )
-
 @B = external global i32
-
 global <4 x i1> icmp slt ( <4 x i32> <i32 ptrtoint (i32 * @B to i32), i32 1, i32 1, i32 1>, <4 x i32>  <i32 1, i32 2, i32 1, i32 2> )
index 87af602aaf598974323237ef501f4648a8e31ed2..ae8358abf9a19be96285685280be1e27eb41a70e 100644 (file)
@@ -1,11 +1,11 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep select
-; rudimentary test of select on vectors returning vector of bool
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; Rudimentary test of select on vectors returning vector of bool
 
-define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b,
-    <4 x i1> %cond) nounwind  {
+; CHECK: @foo
+; CHECK: select <4 x i1> %cond, <4 x i32> %a, <4 x i32> %b
+define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b, <4 x i1> %cond) nounwind  {
 entry:
-  %cmp = select <4 x i1>  %cond, <4 x i32> %a, <4 x i32> %b 
-                             ; <4 x i32> [#uses=1]
+  %cmp = select <4 x i1>  %cond, <4 x i32> %a, <4 x i32> %b
   ret <4 x i32> %cmp
 }
 
index 1850e66e8edce228aa5fbe24a6dce115f80f4f24..6a6531b4d2ffdfaaba3e9d1fd3dca55d38a64737 100644 (file)
@@ -1,32 +1,45 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep shl | count 1
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep ashr | count 1
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep lshr | count 1
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
 
+; CHECK: @foo
+; CHECK: shl
 define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b) nounwind  {
 entry:
-       %cmp = shl <4 x i32> %a, %b             ; <4 x i32> [#uses=1]
-       ret <4 x i32> %cmp
+  %cmp = shl <4 x i32> %a, %b          ; <4 x i32> [#uses=1]
+  ret <4 x i32> %cmp
 }
 
+; CHECK: @bar
+; CHECK: lshr
 define <4 x i32> @bar(<4 x i32> %a, <4 x i32> %b) nounwind  {
 entry:
-       %cmp = lshr <4 x i32> %a, %b            ; <4 x i32> [#uses=1]
-       ret <4 x i32> %cmp
+  %cmp = lshr <4 x i32> %a, %b         ; <4 x i32> [#uses=1]
+  ret <4 x i32> %cmp
 }
 
+; CHECK: @baz
+; CHECK: ashr 
 define <4 x i32> @baz(<4 x i32> %a, <4 x i32> %b) nounwind  {
 entry:
-       %cmp = ashr <4 x i32> %a, %b            ; <4 x i32> [#uses=1]
-       ret <4 x i32> %cmp
+  %cmp = ashr <4 x i32> %a, %b         ; <4 x i32> [#uses=1]
+  ret <4 x i32> %cmp
 }
 
 ; Constant expressions: these should be folded.
+
+; CHECK: @foo_ce
+; CHECK: ret <2 x i64> <i64 40, i64 192>
 define <2 x i64> @foo_ce() nounwind {
   ret <2 x i64> shl (<2 x i64> <i64 5, i64 6>, <2 x i64> <i64 3, i64 5>)
 }
+
+; CHECK: @bar_ce
+; CHECK: ret <2 x i64> <i64 42, i64 11>
 define <2 x i64> @bar_ce() nounwind {
   ret <2 x i64> lshr (<2 x i64> <i64 340, i64 380>, <2 x i64> <i64 3, i64 5>)
 }
+
+; CHECK: baz_ce
+; CHECK: ret <2 x i64> <i64 71, i64 12>
 define <2 x i64> @baz_ce() nounwind {
   ret <2 x i64> ashr (<2 x i64> <i64 573, i64 411>, <2 x i64> <i64 3, i64 5>)
 }
index 5d3dfab5753a5fe14cc3561d66fe837cc10f0eec..b972753da1dd4780df3cabd2f20f601b77ef614d 100644 (file)
@@ -1,2 +1,4 @@
-; RUN: not llvm-dis < %s.bc > /dev/null |& grep "Invalid MODULE_CODE_FUNCTION record"
+; RUN: not llvm-dis < %s.bc > /dev/null |& FileCheck %s
 ; PR8494
+
+; CHECK: Invalid MODULE_CODE_FUNCTION record