aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-11-18 14:59:57 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-11-18 14:59:57 +0000
commitb3d5a323a5ca92ea73443499cee2f15db1ff0fb3 (patch)
tree60a1694bec5a44d15456acc880cb2f91619f66aa /test/CodeGen
parent8f57cb0305232cb53fff00ef151ca716766f3437 (diff)
downloadsrc-b3d5a323a5ca92ea73443499cee2f15db1ff0fb3.tar.gz
src-b3d5a323a5ca92ea73443499cee2f15db1ff0fb3.zip
Update clang to r89205.
Notes
Notes: svn path=/vendor/clang/dist/; revision=199482
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/2008-07-17-no-emit-on-error.c4
-rw-r--r--test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c2
-rw-r--r--test/CodeGen/2008-07-29-override-alias-decl.c18
-rw-r--r--test/CodeGen/2008-07-30-implicit-initialization.c4
-rw-r--r--test/CodeGen/2008-07-31-asm-labels.c14
-rw-r--r--test/CodeGen/2009-10-20-GlobalDebug.c2
-rw-r--r--test/CodeGen/PR2001-bitfield-reload.c4
-rw-r--r--test/CodeGen/PR3589-freestanding-libcalls.c6
-rw-r--r--test/CodeGen/PR3613-static-decl.c2
-rw-r--r--test/CodeGen/PR4611-bitfield-layout.c2
-rw-r--r--test/CodeGen/address-space-field1.c33
-rw-r--r--test/CodeGen/address-space.c8
-rw-r--r--test/CodeGen/alias.c12
-rw-r--r--test/CodeGen/alignof.c2
-rw-r--r--test/CodeGen/always_inline.c8
-rw-r--r--test/CodeGen/arm-arguments.c2
-rw-r--r--test/CodeGen/asm-2.c2
-rw-r--r--test/CodeGen/asm-inout.c2
-rw-r--r--test/CodeGen/asm.c6
-rw-r--r--test/CodeGen/atomic.c22
-rw-r--r--test/CodeGen/attr-nodebug.c2
-rw-r--r--test/CodeGen/attr-noinline.c2
-rw-r--r--test/CodeGen/attr-used.c6
-rw-r--r--test/CodeGen/attributes.c5
-rw-r--r--test/CodeGen/bitfield-assign.c10
-rw-r--r--test/CodeGen/bitfield-promote.c7
-rw-r--r--test/CodeGen/bitfield.c4
-rw-r--r--test/CodeGen/blocks-1.c16
-rw-r--r--test/CodeGen/blocks-2.c6
-rw-r--r--test/CodeGen/blocks-aligned-byref-variable.c2
-rw-r--r--test/CodeGen/blocks-seq.c12
-rw-r--r--test/CodeGen/blocks.c5
-rw-r--r--test/CodeGen/builtin-count-zeros.c2
-rw-r--r--test/CodeGen/builtin-memfns.c8
-rw-r--r--test/CodeGen/builtin-nanf.c2
-rw-r--r--test/CodeGen/builtin-stackaddress.c2
-rw-r--r--test/CodeGen/builtins-ffs_parity_popcount.c2
-rw-r--r--test/CodeGen/builtins-powi.c2
-rw-r--r--test/CodeGen/builtins-x86.c2
-rw-r--r--test/CodeGen/builtins.c4
-rw-r--r--test/CodeGen/c-strings.c8
-rw-r--r--test/CodeGen/cleanup-stack.c2
-rw-r--r--test/CodeGen/compound-type.c4
-rw-r--r--test/CodeGen/conditional.c8
-rw-r--r--test/CodeGen/const-init.c12
-rw-r--r--test/CodeGen/constant-comparison.c2
-rw-r--r--test/CodeGen/constructor-attribute.c10
-rw-r--r--test/CodeGen/darwin-string-literals.c2
-rw-r--r--test/CodeGen/debug-info.c2
-rw-r--r--test/CodeGen/designated-initializers.c4
-rw-r--r--test/CodeGen/dllimport-dllexport.c4
-rw-r--r--test/CodeGen/emit-all-decls.c6
-rw-r--r--test/CodeGen/ext-vector-shuffle.c4
-rw-r--r--test/CodeGen/flexible-array-init.c6
-rw-r--r--test/CodeGen/functions.c8
-rw-r--r--test/CodeGen/global-decls.c13
-rw-r--r--test/CodeGen/init.c4
-rw-r--r--test/CodeGen/inline.c74
-rw-r--r--test/CodeGen/inline2.c2
-rw-r--r--test/CodeGen/libcalls.c10
-rw-r--r--test/CodeGen/lineno-dbginfo.c6
-rw-r--r--test/CodeGen/mandel.c2
-rw-r--r--test/CodeGen/no-common.c6
-rw-r--r--test/CodeGen/object-size.c24
-rw-r--r--test/CodeGen/packed-union.c4
-rw-r--r--test/CodeGen/parameter-passing.c13
-rw-r--r--test/CodeGen/pragma-pack-2.c2
-rw-r--r--test/CodeGen/pragma-pack-3.c2
-rw-r--r--test/CodeGen/predefined-expr.c2
-rw-r--r--test/CodeGen/private-extern.c4
-rw-r--r--test/CodeGen/rdr-6098585-default-after-caserange.c4
-rw-r--r--test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c2
-rw-r--r--test/CodeGen/rdr-6098585-empty-case-range.c4
-rw-r--r--test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c2
-rw-r--r--test/CodeGen/rdr-6098585-unsigned-caserange.c4
-rw-r--r--test/CodeGen/stack-protector.c19
-rw-r--r--test/CodeGen/staticinit.c4
-rw-r--r--test/CodeGen/stdcall-fastcall.c2
-rw-r--r--test/CodeGen/string-init.c6
-rw-r--r--test/CodeGen/struct-passing.c15
-rw-r--r--test/CodeGen/struct-x86-darwin.c18
-rw-r--r--test/CodeGen/target-data.c13
-rw-r--r--test/CodeGen/tentative-decls.c15
-rw-r--r--test/CodeGen/trapv.c2
-rw-r--r--test/CodeGen/unreachable.c2
-rw-r--r--test/CodeGen/unwind-attr.c2
-rw-r--r--test/CodeGen/visibility.c49
-rw-r--r--test/CodeGen/volatile-1.c6
-rw-r--r--test/CodeGen/volatile.c4
-rw-r--r--test/CodeGen/x86.c16
-rw-r--r--test/CodeGen/x86_32-arguments.c111
-rw-r--r--test/CodeGen/x86_64-arguments.c51
92 files changed, 431 insertions, 426 deletions
diff --git a/test/CodeGen/2008-07-17-no-emit-on-error.c b/test/CodeGen/2008-07-17-no-emit-on-error.c
index 51ba2b45d063..fbff54149bcc 100644
--- a/test/CodeGen/2008-07-17-no-emit-on-error.c
+++ b/test/CodeGen/2008-07-17-no-emit-on-error.c
@@ -1,5 +1,5 @@
-// RUN: rm -f %t1.bc &&
-// RUN: not clang-cc %s -emit-llvm-bc -o %t1.bc &&
+// RUN: rm -f %t1.bc
+// RUN: not clang-cc %s -emit-llvm-bc -o %t1.bc
// RUN: not test -f %t1.bc
void f() {
diff --git a/test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c b/test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c
index 348ea75ea295..db3c4b25d375 100644
--- a/test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c
+++ b/test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c
@@ -9,4 +9,4 @@ struct et7 {
};
// CHECK: @yv7 = global
-// CHECK: i8 52, \ No newline at end of file
+// CHECK: i8 52,
diff --git a/test/CodeGen/2008-07-29-override-alias-decl.c b/test/CodeGen/2008-07-29-override-alias-decl.c
index 872950029618..18e8982832e0 100644
--- a/test/CodeGen/2008-07-29-override-alias-decl.c
+++ b/test/CodeGen/2008-07-29-override-alias-decl.c
@@ -2,10 +2,10 @@
int x() { return 1; }
-// CHECK: %retval = alloca i32
-// CHECK: store i32 1, i32* %retval
-// CHECK: %0 = load i32* %retval
-// CHECK: ret i32 %0
+// CHECK: [[retval:%.*]] = alloca i32
+// CHECK: store i32 1, i32* [[retval]]
+// CHECK: [[load:%.*]] = load i32* [[retval]]
+// CHECK: ret i32 [[load]]
int f() __attribute__((weak, alias("x")));
@@ -17,9 +17,9 @@ int h() {
return f();
}
-// CHECK: %retval = alloca i32
-// CHECK: %call = call i32 (...)* @f()
-// CHECK: store i32 %call, i32* %retval
-// CHECK: %0 = load i32* %retval
-// CHECK: ret i32 %0
+// CHECK: [[retval:%.*]] = alloca i32
+// CHECK: [[call:%.*]] = call i32 (...)* @f()
+// CHECK: store i32 [[call]], i32* [[retval]]
+// CHECK: [[load:%.*]] = load i32* [[retval]]
+// CHECK: ret i32 [[load]]
diff --git a/test/CodeGen/2008-07-30-implicit-initialization.c b/test/CodeGen/2008-07-30-implicit-initialization.c
index 2f4c14eb728b..9cd530045bca 100644
--- a/test/CodeGen/2008-07-30-implicit-initialization.c
+++ b/test/CodeGen/2008-07-30-implicit-initialization.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t &&
-// RUN: grep "ret i32" %t | count 2 &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t
+// RUN: grep "ret i32" %t | count 2
// RUN: grep "ret i32 0" %t | count 2
// <rdar://problem/6113085>
diff --git a/test/CodeGen/2008-07-31-asm-labels.c b/test/CodeGen/2008-07-31-asm-labels.c
index f114f65eded2..d2dcc04bf584 100644
--- a/test/CodeGen/2008-07-31-asm-labels.c
+++ b/test/CodeGen/2008-07-31-asm-labels.c
@@ -1,10 +1,10 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep "@pipe()" %t | count 0 &&
-// RUN: grep '_thisIsNotAPipe' %t | count 3 &&
-// RUN: grep 'g0' %t | count 0 &&
-// RUN: grep '_renamed' %t | count 2 &&
-// RUN: clang-cc -DUSE_DEF -emit-llvm -o %t %s &&
-// RUN: grep "@pipe()" %t | count 0 &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep "@pipe()" %t | count 0
+// RUN: grep '_thisIsNotAPipe' %t | count 3
+// RUN: grep 'g0' %t | count 0
+// RUN: grep '_renamed' %t | count 2
+// RUN: clang-cc -DUSE_DEF -emit-llvm -o %t %s
+// RUN: grep "@pipe()" %t | count 0
// RUN: grep '_thisIsNotAPipe' %t | count 3
// <rdr://6116729>
diff --git a/test/CodeGen/2009-10-20-GlobalDebug.c b/test/CodeGen/2009-10-20-GlobalDebug.c
index eea3fb5307b4..fddc76c14da8 100644
--- a/test/CodeGen/2009-10-20-GlobalDebug.c
+++ b/test/CodeGen/2009-10-20-GlobalDebug.c
@@ -1,4 +1,4 @@
// RUN: clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s
int global;
-// CHECK: asciz "global" ## DW_AT_MIPS_linkage_name
+// CHECK: asciz "global" ## DW_AT_name
int main() { return 0;}
diff --git a/test/CodeGen/PR2001-bitfield-reload.c b/test/CodeGen/PR2001-bitfield-reload.c
index 797b494cf823..1fef3c56b53d 100644
--- a/test/CodeGen/PR2001-bitfield-reload.c
+++ b/test/CodeGen/PR2001-bitfield-reload.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t &&
-// RUN: grep "ret i32" %t | count 1 &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t
+// RUN: grep "ret i32" %t | count 1
// RUN: grep "ret i32 1" %t | count 1
// PR2001
diff --git a/test/CodeGen/PR3589-freestanding-libcalls.c b/test/CodeGen/PR3589-freestanding-libcalls.c
index 90b5fff1620f..14608137188e 100644
--- a/test/CodeGen/PR3589-freestanding-libcalls.c
+++ b/test/CodeGen/PR3589-freestanding-libcalls.c
@@ -1,8 +1,8 @@
-// RUN: clang-cc -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1 &&
-// RUN: clang-cc -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1 &&
+// RUN: clang-cc -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1
+// RUN: clang-cc -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1
// RUN: clang-cc -ffreestanding -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 0
-#include <stdio.h>
+int printf(const char *, ...);
void f0() {
printf("hello\n");
diff --git a/test/CodeGen/PR3613-static-decl.c b/test/CodeGen/PR3613-static-decl.c
index 208358130000..a9dc74458926 100644
--- a/test/CodeGen/PR3613-static-decl.c
+++ b/test/CodeGen/PR3613-static-decl.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o %t %s
// RUN: grep '@g0 = internal global %.truct.s0 { i32 3 }' %t | count 1
struct s0 {
diff --git a/test/CodeGen/PR4611-bitfield-layout.c b/test/CodeGen/PR4611-bitfield-layout.c
index 83ce4ffdbd6d..bc514bf4dfe2 100644
--- a/test/CodeGen/PR4611-bitfield-layout.c
+++ b/test/CodeGen/PR4611-bitfield-layout.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t &&
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t
// RUN: grep "struct.object_entry = type { i8, \[2 x i8\], i8 }" %t
struct object_entry {
diff --git a/test/CodeGen/address-space-field1.c b/test/CodeGen/address-space-field1.c
index f8ec83ca71cf..b041cf55d0b0 100644
--- a/test/CodeGen/address-space-field1.c
+++ b/test/CodeGen/address-space-field1.c
@@ -1,23 +1,22 @@
// RUN: clang-cc -emit-llvm < %s -o - | FileCheck %s
// CHECK:%struct.S = type { i32, i32 }
// CHECK:define void @test_addrspace(%struct.S addrspace(1)* %p1, %struct.S addrspace(2)* %p2) nounwind
-// CHECK:entry:
-// CHECK: %p1.addr = alloca %struct.S addrspace(1)* ; <%struct.S addrspace(1)**> [#uses=3]
-// CHECK: %p2.addr = alloca %struct.S addrspace(2)* ; <%struct.S addrspace(2)**> [#uses=3]
-// CHECK: store %struct.S addrspace(1)* %p1, %struct.S addrspace(1)** %p1.addr
-// CHECK: store %struct.S addrspace(2)* %p2, %struct.S addrspace(2)** %p2.addr
-// CHECK: %tmp = load %struct.S addrspace(2)** %p2.addr ; <%struct.S addrspace(2)*> [#uses=1]
-// CHECK: %tmp1 = getelementptr inbounds %struct.S addrspace(2)* %tmp, i32 0, i32 1 ; <i32 addrspace(2)*> [#uses=1]
-// CHECK: %tmp2 = load i32 addrspace(2)* %tmp1 ; <i32> [#uses=1]
-// CHECK: %tmp3 = load %struct.S addrspace(1)** %p1.addr ; <%struct.S addrspace(1)*> [#uses=1]
-// CHECK: %tmp4 = getelementptr inbounds %struct.S addrspace(1)* %tmp3, i32 0, i32 0 ; <i32 addrspace(1)*> [#uses=1]
-// CHECK: store i32 %tmp2, i32 addrspace(1)* %tmp4
-// CHECK: %tmp5 = load %struct.S addrspace(2)** %p2.addr ; <%struct.S addrspace(2)*> [#uses=1]
-// CHECK: %tmp6 = getelementptr inbounds %struct.S addrspace(2)* %tmp5, i32 0, i32 0 ; <i32 addrspace(2)*> [#uses=1]
-// CHECK: %tmp7 = load i32 addrspace(2)* %tmp6 ; <i32> [#uses=1]
-// CHECK: %tmp8 = load %struct.S addrspace(1)** %p1.addr ; <%struct.S addrspace(1)*> [#uses=1]
-// CHECK: %tmp9 = getelementptr inbounds %struct.S addrspace(1)* %tmp8, i32 0, i32 1 ; <i32 addrspace(1)*> [#uses=1]
-// CHECK: store i32 %tmp7, i32 addrspace(1)* %tmp9
+// CHECK: [[p1addr:%.*]] = alloca %struct.S addrspace(1)* ; <%struct.S addrspace(1)**> [#uses=3]
+// CHECK: [[p2addr:%.*]] = alloca %struct.S addrspace(2)* ; <%struct.S addrspace(2)**> [#uses=3]
+// CHECK: store %struct.S addrspace(1)* %p1, %struct.S addrspace(1)** [[p1addr]]
+// CHECK: store %struct.S addrspace(2)* %p2, %struct.S addrspace(2)** [[p2addr]]
+// CHECK: [[t0:%.*]] = load %struct.S addrspace(2)** [[p2addr]] ; <%struct.S addrspace(2)*> [#uses=1]
+// CHECK: [[t1:%.*]] = getelementptr inbounds %struct.S addrspace(2)* [[t0]], i32 0, i32 1 ; <i32 addrspace(2)*> [#uses=1]
+// CHECK: [[t2:%.*]] = load i32 addrspace(2)* [[t1]] ; <i32> [#uses=1]
+// CHECK: [[t3:%.*]] = load %struct.S addrspace(1)** [[p1addr]] ; <%struct.S addrspace(1)*> [#uses=1]
+// CHECK: [[t4:%.*]] = getelementptr inbounds %struct.S addrspace(1)* [[t3]], i32 0, i32 0 ; <i32 addrspace(1)*> [#uses=1]
+// CHECK: store i32 [[t2]], i32 addrspace(1)* [[t4]]
+// CHECK: [[t5:%.*]] = load %struct.S addrspace(2)** [[p2addr]] ; <%struct.S addrspace(2)*> [#uses=1]
+// CHECK: [[t6:%.*]] = getelementptr inbounds %struct.S addrspace(2)* [[t5]], i32 0, i32 0 ; <i32 addrspace(2)*> [#uses=1]
+// CHECK: [[t7:%.*]] = load i32 addrspace(2)* [[t6]] ; <i32> [#uses=1]
+// CHECK: [[t8:%.*]] = load %struct.S addrspace(1)** [[p1addr]] ; <%struct.S addrspace(1)*> [#uses=1]
+// CHECK: [[t9:%.*]] = getelementptr inbounds %struct.S addrspace(1)* [[t8]], i32 0, i32 1 ; <i32 addrspace(1)*> [#uses=1]
+// CHECK: store i32 [[t7]], i32 addrspace(1)* [[t9]]
// CHECK: ret void
// CHECK:}
diff --git a/test/CodeGen/address-space.c b/test/CodeGen/address-space.c
index 3b6a8e654167..8536f161533b 100644
--- a/test/CodeGen/address-space.c
+++ b/test/CodeGen/address-space.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -emit-llvm < %s | grep '@foo.*global.*addrspace(1)' &&
-// RUN: clang-cc -emit-llvm < %s | grep '@ban.*global.*addrspace(1)' &&
-// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(1)' | count 2 &&
-// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(2).. @A' &&
+// RUN: clang-cc -emit-llvm < %s | grep '@foo.*global.*addrspace(1)'
+// RUN: clang-cc -emit-llvm < %s | grep '@ban.*global.*addrspace(1)'
+// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(1)' | count 2
+// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(2).. @A'
// RUN: clang-cc -emit-llvm < %s | grep 'load.*addrspace(2).. @B'
int foo __attribute__((address_space(1)));
diff --git a/test/CodeGen/alias.c b/test/CodeGen/alias.c
index b0c71fbdfca4..f8836e6f605f 100644
--- a/test/CodeGen/alias.c
+++ b/test/CodeGen/alias.c
@@ -1,8 +1,8 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
-// RUN: grep '@g0 = common global i32 0' %t &&
-// RUN: grep '@f1 = alias void ()\* @f0' %t &&
-// RUN: grep '@g1 = alias i32\* @g0' %t &&
-// RUN: grep 'define void @f0() nounwind {' %t &&
+// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
+// RUN: grep '@g0 = common global i32 0' %t
+// RUN: grep '@f1 = alias void ()\* @f0' %t
+// RUN: grep '@g1 = alias i32\* @g0' %t
+// RUN: grep 'define void @f0() nounwind {' %t
void f0(void) { }
extern void f1(void);
@@ -14,7 +14,7 @@ extern int g1 __attribute((alias("g0")));
// Make sure that aliases cause referenced values to be emitted.
// PR3200
-// RUN: grep 'define internal i32 @foo1()' %t &&
+// RUN: grep 'define internal i32 @foo1()' %t
static inline int foo1() { return 0; }
int foo() __attribute__((alias("foo1")));
diff --git a/test/CodeGen/alignof.c b/test/CodeGen/alignof.c
index d39f4e418eb1..71c275018ed5 100644
--- a/test/CodeGen/alignof.c
+++ b/test/CodeGen/alignof.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -O1 -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple i386-unknown-unknown -O1 -emit-llvm -o %t %s
// RUN: grep 'ret i32 4' %t
enum e0 { E0 };
diff --git a/test/CodeGen/always_inline.c b/test/CodeGen/always_inline.c
index c12b45404d2d..d995ea11be09 100644
--- a/test/CodeGen/always_inline.c
+++ b/test/CodeGen/always_inline.c
@@ -1,7 +1,7 @@
-// RUN: clang -emit-llvm -S -o %t %s &&
-// RUN: not grep '@f0' %t &&
-// RUN: not grep 'call ' %t &&
-// RUN: clang -mllvm -disable-llvm-optzns -emit-llvm -S -o %t %s &&
+// RUN: clang -emit-llvm -S -o %t %s
+// RUN: not grep '@f0' %t
+// RUN: not grep 'call ' %t
+// RUN: clang -mllvm -disable-llvm-optzns -emit-llvm -S -o %t %s
// RUN: grep '@f0' %t | count 2
//static int f0() {
diff --git a/test/CodeGen/arm-arguments.c b/test/CodeGen/arm-arguments.c
index c43ede2ca05e..3b2c433a89ff 100644
--- a/test/CodeGen/arm-arguments.c
+++ b/test/CodeGen/arm-arguments.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple armv7-apple-darwin9 -target-abi=apcs-gnu -emit-llvm -w -o - %s | FileCheck -check-prefix=APCS-GNU %s &&
+// RUN: clang-cc -triple armv7-apple-darwin9 -target-abi=apcs-gnu -emit-llvm -w -o - %s | FileCheck -check-prefix=APCS-GNU %s
// RUN: clang-cc -triple armv7-apple-darwin9 -target-abi=aapcs -emit-llvm -w -o - %s | FileCheck -check-prefix=AAPCS %s
// APCS-GNU: define arm_apcscc signext i8 @f0()
diff --git a/test/CodeGen/asm-2.c b/test/CodeGen/asm-2.c
index f5b378eb1017..72b23b150592 100644
--- a/test/CodeGen/asm-2.c
+++ b/test/CodeGen/asm-2.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm %s -o %t -triple i386-pc-linux-gnu -O2 &&
+// RUN: clang-cc -emit-llvm %s -o %t -triple i386-pc-linux-gnu -O2
// RUN: not grep "load" %t
// <rdar://problem/6841383>
diff --git a/test/CodeGen/asm-inout.c b/test/CodeGen/asm-inout.c
index bd287ad0ee69..8ddd2acaf87c 100644
--- a/test/CodeGen/asm-inout.c
+++ b/test/CodeGen/asm-inout.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t
// RUN: grep "load i8\*\*\* %p.addr" %t | count 1
// XFAIL: *
diff --git a/test/CodeGen/asm.c b/test/CodeGen/asm.c
index 52afc9152748..41951b8ac21f 100644
--- a/test/CodeGen/asm.c
+++ b/test/CodeGen/asm.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t
void t1(int len) {
__asm__ volatile("" : "=&r"(len), "+&r"(len));
}
@@ -28,12 +28,12 @@ void t6(void) {
__asm__ volatile("" : : "i" (t6));
}
-// RUN: grep "T7 NAMED: \$1" %t &&
+// RUN: grep "T7 NAMED: \$1" %t
void t7(int a) {
__asm__ volatile("T7 NAMED: %[input]" : "+r"(a): [input] "i" (4));
}
-// RUN: grep "T8 NAMED MODIFIER: \${0:c}" %t &&
+// RUN: grep "T8 NAMED MODIFIER: \${0:c}" %t
void t8() {
__asm__ volatile("T8 NAMED MODIFIER: %c[input]" :: [input] "i" (4));
}
diff --git a/test/CodeGen/atomic.c b/test/CodeGen/atomic.c
index 66dc702bfee9..355f7b83231e 100644
--- a/test/CodeGen/atomic.c
+++ b/test/CodeGen/atomic.c
@@ -1,14 +1,14 @@
-// RUN: clang-cc %s -emit-llvm -o - -triple=i686-apple-darwin9 > %t1 &&
-// RUN: grep @llvm.atomic.load.add.i32 %t1 | count 3 &&
-// RUN: grep @llvm.atomic.load.sub.i8 %t1 | count 2 &&
-// RUN: grep @llvm.atomic.load.min.i32 %t1 &&
-// RUN: grep @llvm.atomic.load.max.i32 %t1 &&
-// RUN: grep @llvm.atomic.load.umin.i32 %t1 &&
-// RUN: grep @llvm.atomic.load.umax.i32 %t1 &&
-// RUN: grep @llvm.atomic.swap.i32 %t1 &&
-// RUN: grep @llvm.atomic.cmp.swap.i32 %t1 | count 4 &&
-// RUN: grep @llvm.atomic.load.and.i32 %t1 | count 2 &&
-// RUN: grep @llvm.atomic.load.or.i8 %t1 &&
+// RUN: clang-cc %s -emit-llvm -o - -triple=i686-apple-darwin9 > %t1
+// RUN: grep @llvm.atomic.load.add.i32 %t1 | count 3
+// RUN: grep @llvm.atomic.load.sub.i8 %t1 | count 2
+// RUN: grep @llvm.atomic.load.min.i32 %t1
+// RUN: grep @llvm.atomic.load.max.i32 %t1
+// RUN: grep @llvm.atomic.load.umin.i32 %t1
+// RUN: grep @llvm.atomic.load.umax.i32 %t1
+// RUN: grep @llvm.atomic.swap.i32 %t1
+// RUN: grep @llvm.atomic.cmp.swap.i32 %t1 | count 4
+// RUN: grep @llvm.atomic.load.and.i32 %t1 | count 2
+// RUN: grep @llvm.atomic.load.or.i8 %t1
// RUN: grep @llvm.atomic.load.xor.i8 %t1
diff --git a/test/CodeGen/attr-nodebug.c b/test/CodeGen/attr-nodebug.c
index b96ad26d6d04..e0c813399fb9 100644
--- a/test/CodeGen/attr-nodebug.c
+++ b/test/CodeGen/attr-nodebug.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -g -emit-llvm -o %t %s &&
+// RUN: clang-cc -g -emit-llvm -o %t %s
// RUN: not grep 'call void @llvm.dbg.func.start' %t
void t1() __attribute__((nodebug));
diff --git a/test/CodeGen/attr-noinline.c b/test/CodeGen/attr-noinline.c
index 199c2918d425..719d6eb88fb3 100644
--- a/test/CodeGen/attr-noinline.c
+++ b/test/CodeGen/attr-noinline.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -g -emit-llvm -o %t %s &&
+// RUN: clang-cc -g -emit-llvm -o %t %s
// RUN: grep 'noinline' %t
void t1() __attribute__((noinline));
diff --git a/test/CodeGen/attr-used.c b/test/CodeGen/attr-used.c
index 8521ffd2e4bb..5537ec2f4cef 100644
--- a/test/CodeGen/attr-used.c
+++ b/test/CodeGen/attr-used.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep '@llvm.used = .*@g0' %t &&
-// RUN: grep '@llvm.used = .*@f0' %t &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep '@llvm.used = .*@g0' %t
+// RUN: grep '@llvm.used = .*@f0' %t
// RUN: grep '@llvm.used = .*@f1.l0' %t
diff --git a/test/CodeGen/attributes.c b/test/CodeGen/attributes.c
index d539e033a7e9..29672c2ecb3d 100644
--- a/test/CodeGen/attributes.c
+++ b/test/CodeGen/attributes.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -triple i386-linux-gnu -o %t %s &&
+// RUN: clang-cc -emit-llvm -triple i386-linux-gnu -o %t %s
// RUN: FileCheck --input-file=%t %s
// CHECK: @t5 = weak global i32 2
@@ -69,8 +69,7 @@ int t19(void) {
}
// CHECK:define void @t20() nounwind {
-// CHECK-NEXT:entry:
-// CHECK-NEXT: call void @abort()
+// CHECK: call void @abort()
// CHECK-NEXT: unreachable
void t20(void) {
__builtin_abort();
diff --git a/test/CodeGen/bitfield-assign.c b/test/CodeGen/bitfield-assign.c
index 05d4dda353c7..575a9fb766cf 100644
--- a/test/CodeGen/bitfield-assign.c
+++ b/test/CodeGen/bitfield-assign.c
@@ -4,13 +4,13 @@
/* Check that we get one load for each simple assign and two for the
compound assign (load the old value before the add then load again
to store back). Also check that our g0 pattern is good. */
-// RUN: clang-cc -triple i386-unknown-unknown -O0 -emit-llvm -o %t %s &&
-// RUN: grep 'load ' %t | count 5 &&
-// RUN: grep "@g0" %t | count 4 &&
+// RUN: clang-cc -triple i386-unknown-unknown -O0 -emit-llvm -o %t %s
+// RUN: grep 'load ' %t | count 5
+// RUN: grep "@g0" %t | count 4
// Check that we got the right value.
-// RUN: clang-cc -triple i386-unknown-unknown -O3 -emit-llvm -o %t %s &&
-// RUN: grep 'load ' %t | count 0 &&
+// RUN: clang-cc -triple i386-unknown-unknown -O3 -emit-llvm -o %t %s
+// RUN: grep 'load ' %t | count 0
// RUN: grep "@g0" %t | count 0
struct s0 {
diff --git a/test/CodeGen/bitfield-promote.c b/test/CodeGen/bitfield-promote.c
index 5894e51626da..1290a1ecd33b 100644
--- a/test/CodeGen/bitfield-promote.c
+++ b/test/CodeGen/bitfield-promote.c
@@ -1,7 +1,6 @@
-// RUN: clang -O3 -emit-llvm -S -o %t %s &&
-// RUN: grep 'ret i64 4294967292' %t | count 2 &&
-// RUN: grep 'ret i64 -4' %t | count 1 &&
-// RUN: true
+// RUN: clang -O3 -emit-llvm -S -o %t %s
+// RUN: grep 'ret i64 4294967292' %t | count 2
+// RUN: grep 'ret i64 -4' %t | count 1
long long f0(void) {
struct { unsigned f0 : 32; } x = { 18 };
diff --git a/test/CodeGen/bitfield.c b/test/CodeGen/bitfield.c
index 02f2de79f6bc..9cd79d3d5870 100644
--- a/test/CodeGen/bitfield.c
+++ b/test/CodeGen/bitfield.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t -O3 &&
-// RUN: grep "ret i32" %t | count 4 &&
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t -O3
+// RUN: grep "ret i32" %t | count 4
// RUN: grep "ret i32 1" %t | count 4
static int f0(int n) {
diff --git a/test/CodeGen/blocks-1.c b/test/CodeGen/blocks-1.c
index 10498cb00495..ae5a74aab6f0 100644
--- a/test/CodeGen/blocks-1.c
+++ b/test/CodeGen/blocks-1.c
@@ -1,13 +1,13 @@
-// RUN: clang-cc %s -emit-llvm -o %t -fblocks &&
-// RUN: grep "_Block_object_dispose" %t | count 17 &&
-// RUN: grep "__copy_helper_block_" %t | count 16 &&
-// RUN: grep "__destroy_helper_block_" %t | count 16 &&
-// RUN: grep "__Block_byref_id_object_copy_" %t | count 2 &&
-// RUN: grep "__Block_byref_id_object_dispose_" %t | count 2 &&
-// RUN: grep "i32 135)" %t | count 2 &&
+// RUN: clang-cc %s -emit-llvm -o %t -fblocks
+// RUN: grep "_Block_object_dispose" %t | count 17
+// RUN: grep "__copy_helper_block_" %t | count 16
+// RUN: grep "__destroy_helper_block_" %t | count 16
+// RUN: grep "__Block_byref_id_object_copy_" %t | count 2
+// RUN: grep "__Block_byref_id_object_dispose_" %t | count 2
+// RUN: grep "i32 135)" %t | count 2
// RUN: grep "_Block_object_assign" %t | count 10
-#include <stdio.h>
+int printf(const char *, ...);
void test1() {
__block int a;
diff --git a/test/CodeGen/blocks-2.c b/test/CodeGen/blocks-2.c
index acbaafd95605..c22e882f1b79 100644
--- a/test/CodeGen/blocks-2.c
+++ b/test/CodeGen/blocks-2.c
@@ -1,5 +1,9 @@
-// RUN: clang-cc -g %s -emit-llvm -o %t -fblocks &&
+// RUN: clang-cc -g %s -emit-llvm -o %t -fblocks
// RUN: grep "func.start" %t | count 4
+// RUN: clang-cc -g %s -triple i386-unknown-unknown -emit-llvm -o %t -fblocks -fblock-introspection
+// RUN: grep "v8@?0i4" %t | count 1
+// RUN: clang-cc -g %s -triple i386-unknown-unknown -emit-llvm -o %t -fblocks
+// RUN: grep "v8@?0i4" %t | count 0
// 1 declaration, 1 bar, 1 test_block_dbg and 1 for the block.
// XFAIL: *
diff --git a/test/CodeGen/blocks-aligned-byref-variable.c b/test/CodeGen/blocks-aligned-byref-variable.c
index 1ae306254157..61522fd2da77 100644
--- a/test/CodeGen/blocks-aligned-byref-variable.c
+++ b/test/CodeGen/blocks-aligned-byref-variable.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -o - -triple x86_64-apple-darwin10 &&
+// RUN: clang-cc -emit-llvm -o - -triple x86_64-apple-darwin10
// RUN: clang-cc -emit-llvm -o - -triple i386-apple-darwin10
typedef int __attribute__((aligned(32))) ai;
diff --git a/test/CodeGen/blocks-seq.c b/test/CodeGen/blocks-seq.c
index 3ff241e3f6e3..4006b715f464 100644
--- a/test/CodeGen/blocks-seq.c
+++ b/test/CodeGen/blocks-seq.c
@@ -1,12 +1,12 @@
// FIXME: We forcibly strip the names so that the test doesn't vary between
// builds with and without asserts. We need a better solution for this.
-// RUN: clang-cc -fblocks -triple x86_64-apple-darwin10 -emit-llvm-bc -o - %s | opt -strip | llvm-dis > %t &&
-// RUN: grep '%6 = call i32 (...)\* @rhs()' %t | count 1 &&
-// RUN: grep '%7 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1 &&
-// RUN: grep '%8 = load %0\*\* %7' %t | count 1 &&
-// RUN: grep '%10 = call i32 (...)\* @rhs()' %t | count 1 &&
-// RUN: grep '%11 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1 &&
+// RUN: clang-cc -fblocks -triple x86_64-apple-darwin10 -emit-llvm-bc -o - %s | opt -strip | llvm-dis > %t
+// RUN: grep '%6 = call i32 (...)\* @rhs()' %t | count 1
+// RUN: grep '%7 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1
+// RUN: grep '%8 = load %0\*\* %7' %t | count 1
+// RUN: grep '%10 = call i32 (...)\* @rhs()' %t | count 1
+// RUN: grep '%11 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1
// RUN: grep '%12 = load %0\*\* %11' %t | count 1
int rhs();
diff --git a/test/CodeGen/blocks.c b/test/CodeGen/blocks.c
index 39c5b06b1727..eddf25c74a83 100644
--- a/test/CodeGen/blocks.c
+++ b/test/CodeGen/blocks.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t -fblocks &&
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t -fblocks
void (^f)(void) = ^{};
// rdar://6768379
@@ -12,7 +12,7 @@ struct s0 {
int a[64];
};
-// RUN: grep 'internal void @__f2_block_invoke_(.struct.s0\* noalias sret .*, .*, .* byval .*)' %t &&
+// RUN: grep 'internal void @__f2_block_invoke_(.struct.s0\* noalias sret .*, .*, .* byval .*)' %t
struct s0 f2(struct s0 a0) {
return ^(struct s0 a1){ return a1; }(a0);
}
@@ -27,4 +27,3 @@ void (^test1)(void) = ^(void) {
^ { i = 1; }();
};
-// RUN: true
diff --git a/test/CodeGen/builtin-count-zeros.c b/test/CodeGen/builtin-count-zeros.c
index 374acc43ae58..ff08bd108357 100644
--- a/test/CodeGen/builtin-count-zeros.c
+++ b/test/CodeGen/builtin-count-zeros.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm %s -o - | grep 'cttz' | count 2 &&
+// RUN: clang-cc -emit-llvm %s -o - | grep 'cttz' | count 2
// RUN: clang-cc -emit-llvm %s -o - | grep 'ctlz' | count 2
int a(int a) {return __builtin_ctz(a) + __builtin_clz(a);}
diff --git a/test/CodeGen/builtin-memfns.c b/test/CodeGen/builtin-memfns.c
index 9ae380c5455b..f1d092502dc2 100644
--- a/test/CodeGen/builtin-memfns.c
+++ b/test/CodeGen/builtin-memfns.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
-// RUN: grep '@llvm.memset.i32' %t &&
-// RUN: grep '@llvm.memcpy.i32' %t &&
-// RUN: grep '@llvm.memmove.i32' %t &&
+// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
+// RUN: grep '@llvm.memset.i32' %t
+// RUN: grep '@llvm.memcpy.i32' %t
+// RUN: grep '@llvm.memmove.i32' %t
// RUN: grep __builtin %t | count 0
int main(int argc, char **argv) {
diff --git a/test/CodeGen/builtin-nanf.c b/test/CodeGen/builtin-nanf.c
index e048c7a1aa5a..8f7d2a1e443b 100644
--- a/test/CodeGen/builtin-nanf.c
+++ b/test/CodeGen/builtin-nanf.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep 'float 0x7FF8000000000000, float 0x7FF8000000000000, float 0x7FF8000020000000, float 0x7FF8000000000000, float 0x7FF80001E0000000, float 0x7FF8001E00000000, float 0x7FF801E000000000, float 0x7FF81E0000000000, float 0x7FF9E00000000000, float 0x7FFFFFFFE0000000' %t
float n[] = {
diff --git a/test/CodeGen/builtin-stackaddress.c b/test/CodeGen/builtin-stackaddress.c
index 5c6d540172a0..d8e58c4f6be7 100644
--- a/test/CodeGen/builtin-stackaddress.c
+++ b/test/CodeGen/builtin-stackaddress.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm < %s | grep "llvm.returnaddress" &&
+// RUN: clang-cc -emit-llvm < %s | grep "llvm.returnaddress"
// RUN: clang-cc -emit-llvm < %s | grep "llvm.frameaddress"
void* a(unsigned x) {
return __builtin_return_address(0);
diff --git a/test/CodeGen/builtins-ffs_parity_popcount.c b/test/CodeGen/builtins-ffs_parity_popcount.c
index e3fa4d2d8212..74e104b437c6 100644
--- a/test/CodeGen/builtins-ffs_parity_popcount.c
+++ b/test/CodeGen/builtins-ffs_parity_popcount.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -o - %s > %t &&
+// RUN: clang-cc -emit-llvm -o - %s > %t
// RUN: not grep "__builtin" %t
#include <stdio.h>
diff --git a/test/CodeGen/builtins-powi.c b/test/CodeGen/builtins-powi.c
index 57fa81a3ad12..945ec5dd13ea 100644
--- a/test/CodeGen/builtins-powi.c
+++ b/test/CodeGen/builtins-powi.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -o - %s > %t &&
+// RUN: clang-cc -emit-llvm -o - %s > %t
// RUN: not grep "__builtin" %t
#include <stdio.h>
diff --git a/test/CodeGen/builtins-x86.c b/test/CodeGen/builtins-x86.c
index f49e7b670dec..c82ecde1ff39 100644
--- a/test/CodeGen/builtins-x86.c
+++ b/test/CodeGen/builtins-x86.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -DUSE_64 -triple x86_64-unknown-unknown -emit-llvm -o %t %s &&
+// RUN: clang-cc -DUSE_64 -triple x86_64-unknown-unknown -emit-llvm -o %t %s
// RUN: clang-cc -DUSE_ALL -triple x86_64-unknown-unknown -fsyntax-only -o %t %s
#ifdef USE_ALL
diff --git a/test/CodeGen/builtins.c b/test/CodeGen/builtins.c
index 359d5070ccc1..11bcc14249ac 100644
--- a/test/CodeGen/builtins.c
+++ b/test/CodeGen/builtins.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
+// RUN: clang-cc -emit-llvm -o %t %s
// RUN: not grep __builtin %t
-#include <stdio.h>
+int printf(const char *, ...);
void p(char *str, int x) {
printf("%s: %d\n", str, x);
diff --git a/test/CodeGen/c-strings.c b/test/CodeGen/c-strings.c
index ee85f60ed15a..2cf4036cb675 100644
--- a/test/CodeGen/c-strings.c
+++ b/test/CodeGen/c-strings.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep "hello" %t | count 3 &&
-// RUN: grep 'c"hello\\00"' %t | count 2 &&
-// RUN: grep 'c"hello\\00\\00\\00"' %t | count 1 &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep "hello" %t | count 3
+// RUN: grep 'c"hello\\00"' %t | count 2
+// RUN: grep 'c"hello\\00\\00\\00"' %t | count 1
// RUN: grep 'c"ola"' %t | count 1
/* Should be 3 hello string, two global (of different sizes), the rest
diff --git a/test/CodeGen/cleanup-stack.c b/test/CodeGen/cleanup-stack.c
index b0c5e88d55ec..3954d85de2b0 100644
--- a/test/CodeGen/cleanup-stack.c
+++ b/test/CodeGen/cleanup-stack.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -O3 -emit-llvm %s -o %t &&
+// RUN: clang-cc -triple i386-unknown-unknown -O3 -emit-llvm %s -o %t
// RUN: grep "ret i32 9" %t
struct s0 {
diff --git a/test/CodeGen/compound-type.c b/test/CodeGen/compound-type.c
index 352f6cc3ce65..47eb3a6e57b6 100644
--- a/test/CodeGen/compound-type.c
+++ b/test/CodeGen/compound-type.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc < %s -emit-llvm -triple i686-pc-linux-gnu > %t &&
-// RUN: grep "div i32" %t &&
+// RUN: clang-cc < %s -emit-llvm -triple i686-pc-linux-gnu > %t
+// RUN: grep "div i32" %t
// RUN: grep "shl i32" %t
unsigned char a,b;
diff --git a/test/CodeGen/conditional.c b/test/CodeGen/conditional.c
index 8a30463cb7e4..f55d59071a2f 100644
--- a/test/CodeGen/conditional.c
+++ b/test/CodeGen/conditional.c
@@ -39,3 +39,11 @@ void _php_stream_free3() {
void _php_stream_free4() {
1 ? _efree(0) : free(0);
}
+
+// PR5526
+struct test9 { int a; };
+void* test9spare();
+void test9(struct test9 *p) {
+ p ? p : test9spare();
+}
+
diff --git a/test/CodeGen/const-init.c b/test/CodeGen/const-init.c
index e25da9c6eba0..06cdde9c9575 100644
--- a/test/CodeGen/const-init.c
+++ b/test/CodeGen/const-init.c
@@ -111,3 +111,15 @@ void *g20(void) {
// PR4108
struct g21 {int g21;};
const struct g21 g21 = (struct g21){1};
+
+// PR5474
+struct g22 {int x;} __attribute((packed));
+struct g23 {char a; short b; char c; struct g22 d;};
+struct g23 g24 = {1,2,3,4};
+
+// CHECK: @__func__.g25 = private constant [4 x i8] c"g25\00"
+// CHECK: @g25.g26 = internal global i8* getelementptr inbounds ([4 x i8]* @__func__.g25, i32 0, i32 0)
+int g25() {
+ static const char *g26 = __func__;
+ return *g26;
+}
diff --git a/test/CodeGen/constant-comparison.c b/test/CodeGen/constant-comparison.c
index ea3e8962b333..3089ae48e6e7 100644
--- a/test/CodeGen/constant-comparison.c
+++ b/test/CodeGen/constant-comparison.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm %s -o - 2>&1 | not grep warning &&
+// RUN: clang-cc -emit-llvm %s -o - 2>&1 | not grep warning
// RUN: clang-cc -emit-llvm %s -o - | grep @b | count 1
int a, b;
diff --git a/test/CodeGen/constructor-attribute.c b/test/CodeGen/constructor-attribute.c
index 9a1fa76c622a..b715201dc53b 100644
--- a/test/CodeGen/constructor-attribute.c
+++ b/test/CodeGen/constructor-attribute.c
@@ -1,10 +1,10 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep -e "global_ctors.*@A" %t &&
-// RUN: grep -e "global_dtors.*@B" %t &&
-// RUN: grep -e "global_ctors.*@C" %t &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep -e "global_ctors.*@A" %t
+// RUN: grep -e "global_dtors.*@B" %t
+// RUN: grep -e "global_ctors.*@C" %t
// RUN: grep -e "global_dtors.*@D" %t
-#include <stdio.h>
+int printf(const char *, ...);
void A() __attribute__((constructor));
void B() __attribute__((destructor));
diff --git a/test/CodeGen/darwin-string-literals.c b/test/CodeGen/darwin-string-literals.c
index 04e43a234d19..427e9c2e1b20 100644
--- a/test/CodeGen/darwin-string-literals.c
+++ b/test/CodeGen/darwin-string-literals.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix LSB %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix LSB %s
// CHECK-LSB: @.str = private constant [8 x i8] c"string0\00"
// CHECK-LSB: @.str1 = private constant [8 x i8] c"string1\00"
diff --git a/test/CodeGen/debug-info.c b/test/CodeGen/debug-info.c
index 85ad988bc216..856b91964ebc 100644
--- a/test/CodeGen/debug-info.c
+++ b/test/CodeGen/debug-info.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -o %t --emit-llvm -g %s &&
+// RUN: clang-cc -o %t --emit-llvm -g %s
// RUN: FileCheck --input-file=%t %s
// PR3023
diff --git a/test/CodeGen/designated-initializers.c b/test/CodeGen/designated-initializers.c
index f20bc782b6ac..cc88cef0dcdf 100644
--- a/test/CodeGen/designated-initializers.c
+++ b/test/CodeGen/designated-initializers.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t &&
-// RUN: grep "{ i8\* null, i32 1024 }" %t &&
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t
+// RUN: grep "{ i8\* null, i32 1024 }" %t
// RUN: grep "i32 0, i32 22" %t
struct foo {
diff --git a/test/CodeGen/dllimport-dllexport.c b/test/CodeGen/dllimport-dllexport.c
index fe49ae7a32af..6e259058b7a1 100644
--- a/test/CodeGen/dllimport-dllexport.c
+++ b/test/CodeGen/dllimport-dllexport.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-llvm < %s -o %t &&
-// RUN: grep 'dllexport' %t | count 1 &&
+// RUN: clang-cc -emit-llvm < %s -o %t
+// RUN: grep 'dllexport' %t | count 1
// RUN: not grep 'dllimport' %t
void __attribute__((dllimport)) foo1();
diff --git a/test/CodeGen/emit-all-decls.c b/test/CodeGen/emit-all-decls.c
index 775cb6f118a8..3e7927d8ef79 100644
--- a/test/CodeGen/emit-all-decls.c
+++ b/test/CodeGen/emit-all-decls.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: not grep "@foo" %t &&
-// RUN: clang-cc -femit-all-decls -emit-llvm -o %t %s &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: not grep "@foo" %t
+// RUN: clang-cc -femit-all-decls -emit-llvm -o %t %s
// RUN: grep "@foo" %t
static void foo() {
diff --git a/test/CodeGen/ext-vector-shuffle.c b/test/CodeGen/ext-vector-shuffle.c
index 765551596401..88f8c242e880 100644
--- a/test/CodeGen/ext-vector-shuffle.c
+++ b/test/CodeGen/ext-vector-shuffle.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'extractelement' &&
-// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'insertelement' &&
+// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'extractelement'
+// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'insertelement'
// RUN: clang-cc %s -x cl -emit-llvm -o - | grep 'shufflevector'
typedef __attribute__(( ext_vector_type(2) )) float float2;
diff --git a/test/CodeGen/flexible-array-init.c b/test/CodeGen/flexible-array-init.c
index fb98a8ec07a6..2f0df9057a9a 100644
--- a/test/CodeGen/flexible-array-init.c
+++ b/test/CodeGen/flexible-array-init.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 7 | count 1 &&
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 11 | count 1 &&
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 13 | count 1 &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 7 | count 1
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 11 | count 1
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 13 | count 1
// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | grep 15 | count 1
struct { int x; int y[]; } a = { 1, 7, 11 };
diff --git a/test/CodeGen/functions.c b/test/CodeGen/functions.c
index dba29316e1a3..1c53db411961 100644
--- a/test/CodeGen/functions.c
+++ b/test/CodeGen/functions.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -emit-llvm -o %t &&
+// RUN: clang-cc %s -emit-llvm -o %t
int g();
@@ -19,15 +19,15 @@ void test3(T f) {
int a(int);
int a() {return 1;}
-// RUN: grep 'define void @f0()' %t &&
+// RUN: grep 'define void @f0()' %t
void f0() {}
void f1();
-// RUN: grep 'call void @f1()' %t &&
+// RUN: grep 'call void @f1()' %t
void f2(void) {
f1(1, 2, 3);
}
-// RUN: grep 'define void @f1()' %t &&
+// RUN: grep 'define void @f1()' %t
void f1() {}
// RUN: grep 'define .* @f3' %t | not grep -F '...'
diff --git a/test/CodeGen/global-decls.c b/test/CodeGen/global-decls.c
index decb6a981c7f..c7a70fa237ac 100644
--- a/test/CodeGen/global-decls.c
+++ b/test/CodeGen/global-decls.c
@@ -1,16 +1,16 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
+// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
-// RUN: grep '@g0_ext = extern_weak global i32' %t &&
+// RUN: grep '@g0_ext = extern_weak global i32' %t
extern int g0_ext __attribute__((weak));
-// RUN: grep 'declare extern_weak i32 @g1_ext()' %t &&
+// RUN: grep 'declare extern_weak i32 @g1_ext()' %t
extern int __attribute__((weak)) g1_ext (void);
-// RUN: grep '@g0_common = weak global i32' %t &&
+// RUN: grep '@g0_common = weak global i32' %t
int g0_common __attribute__((weak));
-// RUN: grep '@g0_def = weak global i32' %t &&
+// RUN: grep '@g0_def = weak global i32' %t
int g0_def __attribute__((weak)) = 52;
-// RUN: grep 'define weak i32 @g1_def()' %t &&
+// RUN: grep 'define weak i32 @g1_def()' %t
int __attribute__((weak)) g1_def (void) { return 0; }
// Force _ext references
@@ -19,4 +19,3 @@ void f0() {
int b = g1_ext();
}
-// RUN: true
diff --git a/test/CodeGen/init.c b/test/CodeGen/init.c
index 2e239cf5438c..b0537ae5b077 100644
--- a/test/CodeGen/init.c
+++ b/test/CodeGen/init.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t &&
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t
void f1() {
// Scalars in braces.
@@ -22,7 +22,7 @@ void f3() {
}
// Constants
-// RUN: grep '@g3 = constant i32 10' %t &&
+// RUN: grep '@g3 = constant i32 10' %t
// RUN: grep '@f4.g4 = internal constant i32 12' %t
const int g3 = 10;
int f4() {
diff --git a/test/CodeGen/inline.c b/test/CodeGen/inline.c
index bf17fd7c22ba..76d90eda2100 100644
--- a/test/CodeGen/inline.c
+++ b/test/CodeGen/inline.c
@@ -1,40 +1,40 @@
-// RUN: echo "GNU89 tests:" &&
-// RUN: clang %s -emit-llvm -S -o %t -std=gnu89 &&
-// RUN: grep "define available_externally i32 @ei()" %t &&
-// RUN: grep "define i32 @foo()" %t &&
-// RUN: grep "define i32 @bar()" %t &&
-// RUN: grep "define void @unreferenced1()" %t &&
-// RUN: not grep unreferenced2 %t &&
-// RUN: grep "define void @gnu_inline()" %t &&
-// RUN: grep "define available_externally void @gnu_ei_inline()" %t &&
-// RUN: grep "define i32 @test1" %t &&
-// RUN: grep "define i32 @test2" %t &&
-// RUN: grep "define void @test3()" %t &&
-// RUN: grep "define available_externally i32 @test4" %t &&
-// RUN: grep "define available_externally i32 @test5" %t &&
-
-// RUN: echo "\nC99 tests:" &&
-// RUN: clang %s -emit-llvm -S -o %t -std=c99 &&
-// RUN: grep "define i32 @ei()" %t &&
-// RUN: grep "define available_externally i32 @foo()" %t &&
-// RUN: grep "define i32 @bar()" %t &&
-// RUN: not grep unreferenced1 %t &&
-// RUN: grep "define void @unreferenced2()" %t &&
-// RUN: grep "define void @gnu_inline()" %t &&
-// RUN: grep "define available_externally void @gnu_ei_inline()" %t &&
-// RUN: grep "define i32 @test1" %t &&
-// RUN: grep "define i32 @test2" %t &&
-// RUN: grep "define void @test3" %t &&
-// RUN: grep "define available_externally i32 @test4" %t &&
-// RUN: grep "define available_externally i32 @test5" %t &&
-
-// RUN: echo "\nC++ tests:" &&
-// RUN: clang %s -emit-llvm -S -o %t -std=c++98 &&
-// RUN: grep "define linkonce_odr i32 @_Z2eiv()" %t &&
-// RUN: grep "define linkonce_odr i32 @_Z3foov()" %t &&
-// RUN: grep "define i32 @_Z3barv()" %t &&
-// RUN: not grep unreferenced %t &&
-// RUN: grep "define void @_Z10gnu_inlinev()" %t &&
+// RUN: echo "GNU89 tests:"
+// RUN: clang %s -emit-llvm -S -o %t -std=gnu89
+// RUN: grep "define available_externally i32 @ei()" %t
+// RUN: grep "define i32 @foo()" %t
+// RUN: grep "define i32 @bar()" %t
+// RUN: grep "define void @unreferenced1()" %t
+// RUN: not grep unreferenced2 %t
+// RUN: grep "define void @gnu_inline()" %t
+// RUN: grep "define available_externally void @gnu_ei_inline()" %t
+// RUN: grep "define i32 @test1" %t
+// RUN: grep "define i32 @test2" %t
+// RUN: grep "define void @test3()" %t
+// RUN: grep "define available_externally i32 @test4" %t
+// RUN: grep "define available_externally i32 @test5" %t
+
+// RUN: echo "\nC99 tests:"
+// RUN: clang %s -emit-llvm -S -o %t -std=c99
+// RUN: grep "define i32 @ei()" %t
+// RUN: grep "define available_externally i32 @foo()" %t
+// RUN: grep "define i32 @bar()" %t
+// RUN: not grep unreferenced1 %t
+// RUN: grep "define void @unreferenced2()" %t
+// RUN: grep "define void @gnu_inline()" %t
+// RUN: grep "define available_externally void @gnu_ei_inline()" %t
+// RUN: grep "define i32 @test1" %t
+// RUN: grep "define i32 @test2" %t
+// RUN: grep "define void @test3" %t
+// RUN: grep "define available_externally i32 @test4" %t
+// RUN: grep "define available_externally i32 @test5" %t
+
+// RUN: echo "\nC++ tests:"
+// RUN: clang %s -emit-llvm -S -o %t -std=c++98
+// RUN: grep "define linkonce_odr i32 @_Z2eiv()" %t
+// RUN: grep "define linkonce_odr i32 @_Z3foov()" %t
+// RUN: grep "define i32 @_Z3barv()" %t
+// RUN: not grep unreferenced %t
+// RUN: grep "define void @_Z10gnu_inlinev()" %t
// RUN: grep "define available_externally void @_Z13gnu_ei_inlinev()" %t
extern __inline int ei() { return 123; }
diff --git a/test/CodeGen/inline2.c b/test/CodeGen/inline2.c
index 6f165f50f8b7..304d6168578c 100644
--- a/test/CodeGen/inline2.c
+++ b/test/CodeGen/inline2.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -std=gnu89 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix GNU89 %s &&
+// RUN: clang-cc -std=gnu89 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix GNU89 %s
// RUN: clang-cc -std=c99 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix C99 %s
// CHECK-GNU89: define i32 @f0()
diff --git a/test/CodeGen/libcalls.c b/test/CodeGen/libcalls.c
index ea9e0c3dd91b..cbbde8a9f3fd 100644
--- a/test/CodeGen/libcalls.c
+++ b/test/CodeGen/libcalls.c
@@ -1,8 +1,8 @@
-// RUN: clang-cc -fmath-errno=1 -emit-llvm -o %t %s -triple i386-unknown-unknown &&
-// RUN: grep "declare " %t | count 6 &&
-// RUN: grep "declare " %t | grep "@llvm." | count 1 &&
-// RUN: clang-cc -fmath-errno=0 -emit-llvm -o %t %s -triple i386-unknown-unknown &&
-// RUN: grep "declare " %t | count 6 &&
+// RUN: clang-cc -fmath-errno=1 -emit-llvm -o %t %s -triple i386-unknown-unknown
+// RUN: grep "declare " %t | count 6
+// RUN: grep "declare " %t | grep "@llvm." | count 1
+// RUN: clang-cc -fmath-errno=0 -emit-llvm -o %t %s -triple i386-unknown-unknown
+// RUN: grep "declare " %t | count 6
// RUN: grep "declare " %t | grep -v "@llvm." | count 0
// IRgen only pays attention to const; it should always call llvm for
diff --git a/test/CodeGen/lineno-dbginfo.c b/test/CodeGen/lineno-dbginfo.c
index 12c32ce9dd4b..b78dd21d72b3 100644
--- a/test/CodeGen/lineno-dbginfo.c
+++ b/test/CodeGen/lineno-dbginfo.c
@@ -1,6 +1,6 @@
-// RUN: echo "#include <stdio.h>" > %t.h &&
-// RUN: clang -S -save-temps -g -include %t.h %s -emit-llvm -o %t.ll &&
-// RUN: grep "i32 5" %t.ll &&
+// RUN: echo "#include <stdio.h>" > %t.h
+// RUN: clang -S -save-temps -g -include %t.h %s -emit-llvm -o %t.ll
+// RUN: grep "i32 5" %t.ll
// RUN: rm -f lineno-dbginfo.i
// outer is at line number 5.
int outer = 42;
diff --git a/test/CodeGen/mandel.c b/test/CodeGen/mandel.c
index 27993f0559e9..9d7956c56d1b 100644
--- a/test/CodeGen/mandel.c
+++ b/test/CodeGen/mandel.c
@@ -25,7 +25,7 @@ int main() { return 0; }
#define I 1.0iF
-#include <stdio.h>
+int putchar(char c);
volatile double __complex__ accum;
diff --git a/test/CodeGen/no-common.c b/test/CodeGen/no-common.c
index 190873c745fe..64e37d78f964 100644
--- a/test/CodeGen/no-common.c
+++ b/test/CodeGen/no-common.c
@@ -1,6 +1,6 @@
-// RUN: clang -emit-llvm -S -o %t %s &&
-// RUN: grep '@x = common global' %t &&
-// RUN: clang -fno-common -emit-llvm -S -o %t %s &&
+// RUN: clang -emit-llvm -S -o %t %s
+// RUN: grep '@x = common global' %t
+// RUN: clang -fno-common -emit-llvm -S -o %t %s
// RUN: grep '@x = global' %t
int x;
diff --git a/test/CodeGen/object-size.c b/test/CodeGen/object-size.c
index 61d85419fc69..038d8f98e5d5 100644
--- a/test/CodeGen/object-size.c
+++ b/test/CodeGen/object-size.c
@@ -15,39 +15,39 @@ int gi, gj;
void test1() {
// CHECK: movabsq $59, %rdx
- // CHECK-NEXT: movq %rax, %rdi
- // CHECK-NEXT: movq %rcx, %rsi
+ // CHECK-NEXT: movq
+ // CHECK-NEXT: movq
// CHECK-NEXT: call ___strcpy_chk
strcpy(&gbuf[4], "Hi there");
}
void test2() {
// CHECK: movabsq $63, %rdx
- // CHECK-NEXT: movq %rax, %rdi
- // CHECK-NEXT: movq %rcx, %rsi
+ // CHECK-NEXT: movq
+ // CHECK-NEXT: movq
// CHECK-NEXT: call ___strcpy_chk
strcpy(gbuf, "Hi there");
}
void test3() {
// CHECK: movabsq $0, %rdx
- // CHECK-NEXT: movq %rax, %rdi
- // CHECK-NEXT: movq %rcx, %rsi
+ // CHECK-NEXT: movq
+ // CHECK-NEXT: movq
// CHECK-NEXT: call ___strcpy_chk
strcpy(&gbuf[100], "Hi there");
}
void test4() {
// CHECK: movabsq $0, %rdx
- // CHECK-NEXT: movq %rax, %rdi
- // CHECK-NEXT: movq %rcx, %rsi
+ // CHECK-NEXT: movq
+ // CHECK-NEXT: movq
// CHECK-NEXT: call ___strcpy_chk
strcpy((char*)(void*)&gbuf[-1], "Hi there");
}
void test5() {
- // CHECK: movb $0, %al
- // CHECK-NEXT: testb %al, %al
+ // CHECK: movq $-1, %rax
+ // CHECK-NEXT: cmpq $-1, %rax
// CHECK: call ___inline_strcpy_chk
strcpy(gp, "Hi there");
}
@@ -56,8 +56,8 @@ void test6() {
char buf[57];
// CHECK: movabsq $53, %rdx
- // CHECK-NEXT: movq %rax, %rdi
- // CHECK-NEXT: movq %rcx, %rsi
+ // CHECK-NEXT: movq
+ // CHECK-NEXT: movq
// CHECK-NEXT: call ___strcpy_chk
strcpy(&buf[4], "Hi there");
}
diff --git a/test/CodeGen/packed-union.c b/test/CodeGen/packed-union.c
index d11d3a490234..41dc94c7a410 100644
--- a/test/CodeGen/packed-union.c
+++ b/test/CodeGen/packed-union.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-llvm %s -o %t &&
+// RUN: clang-cc -triple x86_64-apple-darwin10 -emit-llvm %s -o %t
-// RUN: grep "struct._attrs = type <{ i32, i8 }>" %t &&
+// RUN: grep "struct._attrs = type <{ i32, i8 }>" %t
typedef struct _attrs {
unsigned file_attributes;
unsigned char filename_length;
diff --git a/test/CodeGen/parameter-passing.c b/test/CodeGen/parameter-passing.c
index dce0ff80cdc4..966223a39f56 100644
--- a/test/CodeGen/parameter-passing.c
+++ b/test/CodeGen/parameter-passing.c
@@ -5,15 +5,14 @@
// We also check _Bool and empty structures, as these can have annoying
// corner cases.
-// RUN: clang-cc %s -triple i386-unknown-unknown -O3 -emit-llvm -o %t &&
-// RUN: not grep '@g0' %t &&
+// RUN: clang-cc %s -triple i386-unknown-unknown -O3 -emit-llvm -o %t
+// RUN: not grep '@g0' %t
-// RUN: clang-cc %s -triple x86_64-unknown-unknown -O3 -emit-llvm -o %t &&
-// RUN: not grep '@g0' %t &&
+// RUN: clang-cc %s -triple x86_64-unknown-unknown -O3 -emit-llvm -o %t
+// RUN: not grep '@g0' %t
-// RUN: clang-cc %s -triple powerpc-unknown-unknown -O3 -emit-llvm -o %t &&
-// RUN: not grep '@g0' %t &&
-// RUN: true
+// RUN: clang-cc %s -triple powerpc-unknown-unknown -O3 -emit-llvm -o %t
+// RUN: not grep '@g0' %t
typedef _Bool BoolTy;
typedef int ScalarTy;
diff --git a/test/CodeGen/pragma-pack-2.c b/test/CodeGen/pragma-pack-2.c
index 306f02dd8cfe..bfc5dc943c5e 100644
--- a/test/CodeGen/pragma-pack-2.c
+++ b/test/CodeGen/pragma-pack-2.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X32 %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X32 %s
// CHECK-X32: %struct.s0 = type { i64, i64, i32, [12 x i32] }
// CHECK-X32: %struct.s1 = type { [15 x i32], %struct.s0 }
diff --git a/test/CodeGen/pragma-pack-3.c b/test/CodeGen/pragma-pack-3.c
index b9166ae5d390..56a6be3874fa 100644
--- a/test/CodeGen/pragma-pack-3.c
+++ b/test/CodeGen/pragma-pack-3.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X32 %s &&
+// RUN: clang-cc -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck -check-prefix X32 %s
// CHECK-X32: %struct.menu = type <{ i8*, i8, i8 }>
// CHECK-X32: %union.command = type <{ i8*, [2 x i8] }>
diff --git a/test/CodeGen/predefined-expr.c b/test/CodeGen/predefined-expr.c
index 9b645931a4a7..1a5dcb4fc6ff 100644
--- a/test/CodeGen/predefined-expr.c
+++ b/test/CodeGen/predefined-expr.c
@@ -9,7 +9,7 @@
// CHECK: @__func__.staticFunction = private constant [15 x i8] c"staticFunction\00"
// CHECK: @__PRETTY_FUNCTION__.staticFunction = private constant [22 x i8] c"void staticFunction()\00"
-#include <stdio.h>
+int printf(const char *, ...);
void plainFunction() {
printf("__func__ %s\n", __func__);
diff --git a/test/CodeGen/private-extern.c b/test/CodeGen/private-extern.c
index f3ffe5461d06..a9bb28bfad4e 100644
--- a/test/CodeGen/private-extern.c
+++ b/test/CodeGen/private-extern.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
-// RUN: grep '@g0 = external hidden constant i32' %t &&
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: grep '@g0 = external hidden constant i32' %t
// RUN: grep '@g1 = hidden constant i32 1' %t
__private_extern__ const int g0;
diff --git a/test/CodeGen/rdr-6098585-default-after-caserange.c b/test/CodeGen/rdr-6098585-default-after-caserange.c
index 3a11ad64299c..239383a4bdca 100644
--- a/test/CodeGen/rdr-6098585-default-after-caserange.c
+++ b/test/CodeGen/rdr-6098585-default-after-caserange.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
-// RUN: grep "ret i32" %t | count 1 &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
+// RUN: grep "ret i32" %t | count 1
// RUN: grep "ret i32 10" %t | count 1
// Ensure that default after a case range is not ignored.
diff --git a/test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c b/test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c
index f1d15dcd4fd5..39a6bc662dcb 100644
--- a/test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c
+++ b/test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
// RUN: grep "ret i32 10" %t
// Ensure that this doesn't compile to infinite loop in g() due to
diff --git a/test/CodeGen/rdr-6098585-empty-case-range.c b/test/CodeGen/rdr-6098585-empty-case-range.c
index ca5ff1b71225..f80b599ed5a0 100644
--- a/test/CodeGen/rdr-6098585-empty-case-range.c
+++ b/test/CodeGen/rdr-6098585-empty-case-range.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
-// RUN: grep "ret i32" %t | count 2 &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
+// RUN: grep "ret i32" %t | count 2
// RUN: grep "ret i32 3" %t | count 2
// This generated incorrect code because of poor switch chaining.
diff --git a/test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c b/test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c
index b34744970610..6c51a3706716 100644
--- a/test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c
+++ b/test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
// RUN: grep "ret i32 %" %t
// Make sure return is not constant (if empty range is skipped or miscompiled)
diff --git a/test/CodeGen/rdr-6098585-unsigned-caserange.c b/test/CodeGen/rdr-6098585-unsigned-caserange.c
index 80035982e1f4..3b4384bdd70f 100644
--- a/test/CodeGen/rdr-6098585-unsigned-caserange.c
+++ b/test/CodeGen/rdr-6098585-unsigned-caserange.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
-// RUN: grep "ret i32" %t | count 1 &&
+// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
+// RUN: grep "ret i32" %t | count 1
// RUN: grep "ret i32 3" %t | count 1
int f2(unsigned x) {
diff --git a/test/CodeGen/stack-protector.c b/test/CodeGen/stack-protector.c
index 0b5924d81112..c29d1f7f33d9 100644
--- a/test/CodeGen/stack-protector.c
+++ b/test/CodeGen/stack-protector.c
@@ -1,16 +1,9 @@
-// RUN: clang-cc -triple i686-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: not grep 'ssp' %t &&
-// RUN: clang-cc -triple i686-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: not grep 'ssp' %t &&
-// RUN: clang-cc -triple i686-apple-darwin10 -emit-llvm -o %t %s &&
-// RUN: grep 'ssp' %t &&
-// RUN: clang -fstack-protector-all -emit-llvm -S -o %t %s &&
-// RUN: grep 'sspreq' %t &&
-// RUN: clang -fstack-protector -emit-llvm -S -o %t %s &&
-// RUN: grep 'ssp' %t &&
-// RUN: clang -fno-stack-protector -emit-llvm -S -o %t %s &&
-// RUN: not grep 'ssp' %t &&
-// RUN: true
+// RUN: clang-cc -emit-llvm -o - %s -stack-protector=0 | FileCheck -check-prefix=NOSSP %s
+// NOSSP: define void @test1(i8* %msg) nounwind {
+// RUN: clang-cc -emit-llvm -o - %s -stack-protector=1 | FileCheck -check-prefix=WITHSSP %s
+// WITHSSP: define void @test1(i8* %msg) nounwind ssp {
+// RUN: clang-cc -emit-llvm -o - %s -stack-protector=2 | FileCheck -check-prefix=SSPREQ %s
+// SSPREQ: define void @test1(i8* %msg) nounwind sspreq {
int printf(const char * _Format, ...);
diff --git a/test/CodeGen/staticinit.c b/test/CodeGen/staticinit.c
index c68366f2ea77..8b87ccd6b905 100644
--- a/test/CodeGen/staticinit.c
+++ b/test/CodeGen/staticinit.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
-// RUN: grep "g.b = internal global i8. getelementptr" %t &&
+// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
+// RUN: grep "g.b = internal global i8. getelementptr" %t
struct AStruct {
int i;
diff --git a/test/CodeGen/stdcall-fastcall.c b/test/CodeGen/stdcall-fastcall.c
index 89ed8c9ef672..11b652178ca8 100644
--- a/test/CodeGen/stdcall-fastcall.c
+++ b/test/CodeGen/stdcall-fastcall.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm < %s | grep 'fastcallcc' | count 4 &&
+// RUN: clang-cc -emit-llvm < %s | grep 'fastcallcc' | count 4
// RUN: clang-cc -emit-llvm < %s | grep 'stdcallcc' | count 4
void __attribute__((fastcall)) f1(void);
diff --git a/test/CodeGen/string-init.c b/test/CodeGen/string-init.c
index 4a808512601e..0cb6afff611d 100644
--- a/test/CodeGen/string-init.c
+++ b/test/CodeGen/string-init.c
@@ -1,6 +1,6 @@
-// RUN: clang-cc -emit-llvm %s -o %t &&
-// RUN: grep 'private constant \[10 x i8\]' %t &&
-// RUN: not grep -F "[5 x i8]" %t &&
+// RUN: clang-cc -emit-llvm %s -o %t
+// RUN: grep 'private constant \[10 x i8\]' %t
+// RUN: not grep -F "[5 x i8]" %t
// RUN: not grep "store " %t
void test(void) {
diff --git a/test/CodeGen/struct-passing.c b/test/CodeGen/struct-passing.c
index 9a4f47651b74..772077a5964f 100644
--- a/test/CodeGen/struct-passing.c
+++ b/test/CodeGen/struct-passing.c
@@ -1,11 +1,10 @@
-// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
-// RUN: grep 'declare i32 @f0() readnone$' %t &&
-// RUN: grep 'declare i32 @f1() readonly$' %t &&
-// RUN: grep 'declare void @f2(.* noalias sret)$' %t &&
-// RUN: grep 'declare void @f3(.* noalias sret)$' %t &&
-// RUN: grep 'declare void @f4(.* byval)$' %t &&
-// RUN: grep 'declare void @f5(.* byval)$' %t &&
-// RUN: true
+// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
+// RUN: grep 'declare i32 @f0() readnone$' %t
+// RUN: grep 'declare i32 @f1() readonly$' %t
+// RUN: grep 'declare void @f2(.* noalias sret)$' %t
+// RUN: grep 'declare void @f3(.* noalias sret)$' %t
+// RUN: grep 'declare void @f4(.* byval)$' %t
+// RUN: grep 'declare void @f5(.* byval)$' %t
// PR3835
typedef int T0;
diff --git a/test/CodeGen/struct-x86-darwin.c b/test/CodeGen/struct-x86-darwin.c
index c61005f1bebd..e7822f073d2a 100644
--- a/test/CodeGen/struct-x86-darwin.c
+++ b/test/CodeGen/struct-x86-darwin.c
@@ -1,12 +1,12 @@
-// RUN: clang-cc < %s -emit-llvm > %t1 -triple=i686-apple-darwin9 &&
-// RUN: grep "STest1 = type { i32, \[4 x i16\], double }" %t1 &&
-// RUN: grep "STest2 = type { i16, i16, i32, i32 }" %t1 &&
-// RUN: grep "STest3 = type { i8, i16, i32 }" %t1 &&
-// RUN: grep "STestB1 = type { i8, i8 }" %t1 &&
-// RUN: grep "STestB2 = type { i8, i8, i8 }" %t1 &&
-// RUN: grep "STestB3 = type { i8, i8 }" %t1 &&
-// RUN: grep "STestB4 = type { i8, i8, i8, i8 }" %t1 &&
-// RUN: grep "STestB5 = type { i8, i8, \[2 x i8\], i8, i8 }" %t1 &&
+// RUN: clang-cc < %s -emit-llvm > %t1 -triple=i686-apple-darwin9
+// RUN: grep "STest1 = type { i32, \[4 x i16\], double }" %t1
+// RUN: grep "STest2 = type { i16, i16, i32, i32 }" %t1
+// RUN: grep "STest3 = type { i8, i16, i32 }" %t1
+// RUN: grep "STestB1 = type { i8, i8 }" %t1
+// RUN: grep "STestB2 = type { i8, i8, i8 }" %t1
+// RUN: grep "STestB3 = type { i8, i8 }" %t1
+// RUN: grep "STestB4 = type { i8, i8, i8, i8 }" %t1
+// RUN: grep "STestB5 = type { i8, i8, \[2 x i8\], i8, i8 }" %t1
// RUN: grep "STestB6 = type { i8, i8, \[2 x i8\] }" %t1
// Test struct layout for x86-darwin target
diff --git a/test/CodeGen/target-data.c b/test/CodeGen/target-data.c
index 9d73d5c6300d..26775f98117c 100644
--- a/test/CodeGen/target-data.c
+++ b/test/CodeGen/target-data.c
@@ -1,7 +1,6 @@
-// RUN: clang-cc -triple i686-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: grep '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:32:32"' %t &&
-// RUN: clang-cc -triple i686-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: grep '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"' %t &&
-// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: grep 'target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"' %t &&
-// RUN: true
+// RUN: clang-cc -triple i686-unknown-unknown -emit-llvm -o %t %s
+// RUN: grep '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:32:32-n8:16:32"' %t
+// RUN: clang-cc -triple i686-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep '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-n8:16:32"' %t
+// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o %t %s
+// RUN: grep 'target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"' %t
diff --git a/test/CodeGen/tentative-decls.c b/test/CodeGen/tentative-decls.c
index 3301c234c55a..b72c5850ac2c 100644
--- a/test/CodeGen/tentative-decls.c
+++ b/test/CodeGen/tentative-decls.c
@@ -1,16 +1,16 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
+// RUN: clang-cc -emit-llvm -o %t %s
-// RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t &&
+// RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t
int r[];
int (*a)[] = &r;
struct s0;
struct s0 x;
-// RUN: grep '@x = common global .struct.s0 zeroinitializer' %t &&
+// RUN: grep '@x = common global .struct.s0 zeroinitializer' %t
struct s0 y;
-// RUN: grep '@y = common global .struct.s0 zeroinitializer' %t &&
+// RUN: grep '@y = common global .struct.s0 zeroinitializer' %t
struct s0 *f0() {
return &y;
}
@@ -19,21 +19,20 @@ struct s0 {
int x;
};
-// RUN: grep '@b = common global \[1 x .*\] zeroinitializer' %t &&
+// RUN: grep '@b = common global \[1 x .*\] zeroinitializer' %t
int b[];
int *f1() {
return b;
}
// Check that the most recent tentative definition wins.
-// RUN: grep '@c = common global \[4 x .*\] zeroinitializer' %t &&
+// RUN: grep '@c = common global \[4 x .*\] zeroinitializer' %t
int c[];
int c[4];
// Check that we emit static tentative definitions
-// RUN: grep '@c5 = internal global \[1 x .*\] zeroinitializer' %t &&
+// RUN: grep '@c5 = internal global \[1 x .*\] zeroinitializer' %t
static int c5[];
static int func() { return c5[0]; }
int callfunc() { return func(); }
-// RUN: true
diff --git a/test/CodeGen/trapv.c b/test/CodeGen/trapv.c
index c96488b8e99b..6045ed908d0e 100644
--- a/test/CodeGen/trapv.c
+++ b/test/CodeGen/trapv.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -ftrapv %s -emit-llvm -o %t &&
+// RUN: clang-cc -ftrapv %s -emit-llvm -o %t
// RUN: grep "__overflow_handler" %t | count 2
unsigned int ui, uj, uk;
diff --git a/test/CodeGen/unreachable.c b/test/CodeGen/unreachable.c
index ea4f0478bbd4..3f39a27def97 100644
--- a/test/CodeGen/unreachable.c
+++ b/test/CodeGen/unreachable.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -emit-llvm -o %t %s &&
+// RUN: clang-cc -emit-llvm -o %t %s
// RUN: grep '@unreachable' %t | count 0
extern void abort() __attribute__((noreturn));
diff --git a/test/CodeGen/unwind-attr.c b/test/CodeGen/unwind-attr.c
index 86036f94b981..1148ba10315e 100644
--- a/test/CodeGen/unwind-attr.c
+++ b/test/CodeGen/unwind-attr.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fexceptions -emit-llvm -o - %s | grep "@foo()" | not grep nounwind &&
+// RUN: clang-cc -fexceptions -emit-llvm -o - %s | grep "@foo()" | not grep nounwind
// RUN: clang-cc -emit-llvm -o - %s | grep "@foo()" | grep nounwind
int foo(void) {
diff --git a/test/CodeGen/visibility.c b/test/CodeGen/visibility.c
index 958eb618ee70..7c837ba823e9 100644
--- a/test/CodeGen/visibility.c
+++ b/test/CodeGen/visibility.c
@@ -1,28 +1,27 @@
-// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=default -emit-llvm -o %t %s &&
-// RUN: grep '@g_com = common global i32 0' %t &&
-// RUN: grep '@g_def = global i32 0' %t &&
-// RUN: grep '@g_ext = external global i32' %t &&
-// RUN: grep '@g_deferred = internal global' %t &&
-// RUN: grep 'declare void @f_ext()' %t &&
-// RUN: grep 'define internal void @f_deferred()' %t &&
-// RUN: grep 'define i32 @f_def()' %t &&
-// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=protected -emit-llvm -o %t %s &&
-// RUN: grep '@g_com = common protected global i32 0' %t &&
-// RUN: grep '@g_def = protected global i32 0' %t &&
-// RUN: grep '@g_ext = external global i32' %t &&
-// RUN: grep '@g_deferred = internal global' %t &&
-// RUN: grep 'declare void @f_ext()' %t &&
-// RUN: grep 'define internal void @f_deferred()' %t &&
-// RUN: grep 'define protected i32 @f_def()' %t &&
-// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=hidden -emit-llvm -o %t %s &&
-// RUN: grep '@g_com = common hidden global i32 0' %t &&
-// RUN: grep '@g_def = hidden global i32 0' %t &&
-// RUN: grep '@g_ext = external global i32' %t &&
-// RUN: grep '@g_deferred = internal global' %t &&
-// RUN: grep 'declare void @f_ext()' %t &&
-// RUN: grep 'define internal void @f_deferred()' %t &&
-// RUN: grep 'define hidden i32 @f_def()' %t &&
-// RUN: true
+// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=default -emit-llvm -o %t %s
+// RUN: grep '@g_com = common global i32 0' %t
+// RUN: grep '@g_def = global i32 0' %t
+// RUN: grep '@g_ext = external global i32' %t
+// RUN: grep '@g_deferred = internal global' %t
+// RUN: grep 'declare void @f_ext()' %t
+// RUN: grep 'define internal void @f_deferred()' %t
+// RUN: grep 'define i32 @f_def()' %t
+// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=protected -emit-llvm -o %t %s
+// RUN: grep '@g_com = common protected global i32 0' %t
+// RUN: grep '@g_def = protected global i32 0' %t
+// RUN: grep '@g_ext = external global i32' %t
+// RUN: grep '@g_deferred = internal global' %t
+// RUN: grep 'declare void @f_ext()' %t
+// RUN: grep 'define internal void @f_deferred()' %t
+// RUN: grep 'define protected i32 @f_def()' %t
+// RUN: clang-cc -triple i386-unknown-unknown -fvisibility=hidden -emit-llvm -o %t %s
+// RUN: grep '@g_com = common hidden global i32 0' %t
+// RUN: grep '@g_def = hidden global i32 0' %t
+// RUN: grep '@g_ext = external global i32' %t
+// RUN: grep '@g_deferred = internal global' %t
+// RUN: grep 'declare void @f_ext()' %t
+// RUN: grep 'define internal void @f_deferred()' %t
+// RUN: grep 'define hidden i32 @f_def()' %t
int g_com;
int g_def = 0;
diff --git a/test/CodeGen/volatile-1.c b/test/CodeGen/volatile-1.c
index ac3b4c2e97b2..3203326ecebf 100644
--- a/test/CodeGen/volatile-1.c
+++ b/test/CodeGen/volatile-1.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -Wno-unused-value -emit-llvm < %s -o %t &&
-// RUN: grep volatile %t | count 145 &&
+// RUN: clang-cc -Wno-unused-value -emit-llvm < %s -o %t
+// RUN: grep volatile %t | count 145
// RUN: grep memcpy %t | count 4
volatile int i, j, k;
@@ -14,7 +14,7 @@ volatile struct S {
} a, b;
//void operator =(volatile struct S&o1, volatile struct S&o2) volatile;
-#include <stdio.h>
+int printf(const char *, ...);
int main() {
// A use.
diff --git a/test/CodeGen/volatile.c b/test/CodeGen/volatile.c
index e17669008a39..a0cc891ccd88 100644
--- a/test/CodeGen/volatile.c
+++ b/test/CodeGen/volatile.c
@@ -1,5 +1,5 @@
-// RUN: clang-cc -emit-llvm < %s -o %t &&
-// RUN: grep volatile %t | count 29 &&
+// RUN: clang-cc -emit-llvm < %s -o %t
+// RUN: grep volatile %t | count 29
// RUN: grep memcpy %t | count 7
// The number 29 comes from the current codegen for volatile loads;
diff --git a/test/CodeGen/x86.c b/test/CodeGen/x86.c
index be0930237c82..0420a4cd97de 100644
--- a/test/CodeGen/x86.c
+++ b/test/CodeGen/x86.c
@@ -1,11 +1,11 @@
-// RUN: clang-cc %s -triple=i686-pc-linux-gnu -emit-llvm -o - > %t1 &&
-// RUN: grep "ax" %t1 &&
-// RUN: grep "bx" %t1 &&
-// RUN: grep "cx" %t1 &&
-// RUN: grep "dx" %t1 &&
-// RUN: grep "di" %t1 &&
-// RUN: grep "si" %t1 &&
-// RUN: grep "st" %t1 &&
+// RUN: clang-cc %s -triple=i686-pc-linux-gnu -emit-llvm -o - > %t1
+// RUN: grep "ax" %t1
+// RUN: grep "bx" %t1
+// RUN: grep "cx" %t1
+// RUN: grep "dx" %t1
+// RUN: grep "di" %t1
+// RUN: grep "si" %t1
+// RUN: grep "st" %t1
// RUN: grep "st(1)" %t1
void test1() {
diff --git a/test/CodeGen/x86_32-arguments.c b/test/CodeGen/x86_32-arguments.c
index 78fb8342eebd..33f635c31ae1 100644
--- a/test/CodeGen/x86_32-arguments.c
+++ b/test/CodeGen/x86_32-arguments.c
@@ -1,14 +1,14 @@
-// RUN: clang-cc -fblocks -triple i386-apple-darwin9 -emit-llvm -o %t %s &&
-// RUN: grep 'define signext i8 @f0()' %t &&
-// RUN: grep 'define signext i16 @f1()' %t &&
-// RUN: grep 'define i32 @f2()' %t &&
-// RUN: grep 'define float @f3()' %t &&
-// RUN: grep 'define double @f4()' %t &&
-// RUN: grep 'define x86_fp80 @f5()' %t &&
-// RUN: grep 'define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8\* %a4)' %t &&
-// RUN: grep 'define void @f7(i32 %a0)' %t &&
-// RUN: grep 'define i64 @f8_1()' %t &&
-// RUN: grep 'define void @f8_2(i32 %a0.0, i32 %a0.1)' %t &&
+// RUN: clang-cc -fblocks -triple i386-apple-darwin9 -emit-llvm -o %t %s
+// RUN: grep 'define signext i8 @f0()' %t
+// RUN: grep 'define signext i16 @f1()' %t
+// RUN: grep 'define i32 @f2()' %t
+// RUN: grep 'define float @f3()' %t
+// RUN: grep 'define double @f4()' %t
+// RUN: grep 'define x86_fp80 @f5()' %t
+// RUN: grep 'define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8\* %a4)' %t
+// RUN: grep 'define void @f7(i32 %a0)' %t
+// RUN: grep 'define i64 @f8_1()' %t
+// RUN: grep 'define void @f8_2(i32 %a0.0, i32 %a0.1)' %t
char f0(void) {
return 0;
@@ -49,11 +49,11 @@ void f8_2(struct s8 a0) {}
// This should be passed just as s8.
-// RUN: grep 'define i64 @f9_1()' %t &&
+// RUN: grep 'define i64 @f9_1()' %t
// FIXME: llvm-gcc expands this, this may have some value for the
// backend in terms of optimization but doesn't change the ABI.
-// RUN: grep 'define void @f9_2(%.truct.s9\* byval %a0)' %t &&
+// RUN: grep 'define void @f9_2(%.truct.s9\* byval %a0)' %t
struct s9 {
int a : 17;
int b;
@@ -63,7 +63,7 @@ void f9_2(struct s9 a0) {}
// Return of small structures and unions
-// RUN: grep 'float @f10()' %t &&
+// RUN: grep 'float @f10()' %t
struct s10 {
union { };
float f;
@@ -71,12 +71,12 @@ struct s10 {
// Small vectors and 1 x {i64,double} are returned in registers
-// RUN: grep 'i32 @f11()' %t &&
-// RUN: grep -F 'void @f12(<2 x i32>* noalias sret %agg.result)' %t &&
-// RUN: grep 'i64 @f13()' %t &&
-// RUN: grep 'i64 @f14()' %t &&
-// RUN: grep '<2 x i64> @f15()' %t &&
-// RUN: grep '<2 x i64> @f16()' %t &&
+// RUN: grep 'i32 @f11()' %t
+// RUN: grep -F 'void @f12(<2 x i32>* noalias sret %agg.result)' %t
+// RUN: grep 'i64 @f13()' %t
+// RUN: grep 'i64 @f14()' %t
+// RUN: grep '<2 x i64> @f15()' %t
+// RUN: grep '<2 x i64> @f16()' %t
typedef short T11 __attribute__ ((vector_size (4)));
T11 f11(void) { while (1) {} }
typedef int T12 __attribute__ ((vector_size (8)));
@@ -93,12 +93,12 @@ T16 f16(void) { while (1) {} }
// And when the single element in a struct (but not for 64 and
// 128-bits).
-// RUN: grep 'i32 @f17()' %t &&
-// RUN: grep -F 'void @f18(%2* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f19(%3* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f20(%4* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f21(%5* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f22(%6* noalias sret %agg.result)' %t &&
+// RUN: grep 'i32 @f17()' %t
+// RUN: grep -F 'void @f18(%2* noalias sret %agg.result)' %t
+// RUN: grep -F 'void @f19(%3* noalias sret %agg.result)' %t
+// RUN: grep -F 'void @f20(%4* noalias sret %agg.result)' %t
+// RUN: grep -F 'void @f21(%5* noalias sret %agg.result)' %t
+// RUN: grep -F 'void @f22(%6* noalias sret %agg.result)' %t
struct { T11 a; } f17(void) { while (1) {} }
struct { T12 a; } f18(void) { while (1) {} }
struct { T13 a; } f19(void) { while (1) {} }
@@ -108,98 +108,97 @@ struct { T16 a; } f22(void) { while (1) {} }
// Single element structures are handled specially
-// RUN: grep -F 'float @f23()' %t &&
-// RUN: grep -F 'float @f24()' %t &&
-// RUN: grep -F 'float @f25()' %t &&
+// RUN: grep -F 'float @f23()' %t
+// RUN: grep -F 'float @f24()' %t
+// RUN: grep -F 'float @f25()' %t
struct { float a; } f23(void) { while (1) {} }
struct { float a[1]; } f24(void) { while (1) {} }
struct { struct {} a; struct { float a[1]; } b; } f25(void) { while (1) {} }
// Small structures are handled recursively
-// RUN: grep -F 'i32 @f26()' %t &&
-// RUN: grep 'void @f27(%.truct.s27\* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'i32 @f26()' %t
+// RUN: grep 'void @f27(%.truct.s27\* noalias sret %agg.result)' %t
struct s26 { struct { char a, b; } a; struct { char a, b; } b; } f26(void) { while (1) {} }
struct s27 { struct { char a, b, c; } a; struct { char a; } b; } f27(void) { while (1) {} }
-// RUN: grep 'void @f28(%.truct.s28\* noalias sret %agg.result)' %t &&
+// RUN: grep 'void @f28(%.truct.s28\* noalias sret %agg.result)' %t
struct s28 { int a; int b[]; } f28(void) { while (1) {} }
-// RUN: grep 'define i16 @f29()' %t &&
+// RUN: grep 'define i16 @f29()' %t
struct s29 { struct { } a[1]; char b; char c; } f29(void) { while (1) {} }
-// RUN: grep 'define i16 @f30()' %t &&
+// RUN: grep 'define i16 @f30()' %t
struct s30 { char a; char b : 4; } f30(void) { while (1) {} }
-// RUN: grep 'define float @f31()' %t &&
+// RUN: grep 'define float @f31()' %t
struct s31 { char : 0; float b; char : 0; } f31(void) { while (1) {} }
-// RUN: grep 'define i32 @f32()' %t &&
+// RUN: grep 'define i32 @f32()' %t
struct s32 { char a; unsigned : 0; } f32(void) { while (1) {} }
-// RUN: grep 'define float @f33()' %t &&
+// RUN: grep 'define float @f33()' %t
struct s33 { float a; long long : 0; } f33(void) { while (1) {} }
-// RUN: grep 'define float @f34()' %t &&
+// RUN: grep 'define float @f34()' %t
struct s34 { struct { int : 0; } a; float b; } f34(void) { while (1) {} }
-// RUN: grep 'define i16 @f35()' %t &&
+// RUN: grep 'define i16 @f35()' %t
struct s35 { struct { int : 0; } a; char b; char c; } f35(void) { while (1) {} }
-// RUN: grep 'define i16 @f36()' %t &&
+// RUN: grep 'define i16 @f36()' %t
struct s36 { struct { int : 0; } a[2][10]; char b; char c; } f36(void) { while (1) {} }
-// RUN: grep 'define float @f37()' %t &&
+// RUN: grep 'define float @f37()' %t
struct s37 { float c[1][1]; } f37(void) { while (1) {} }
-// RUN: grep 'define void @f38(.struct.s38. noalias sret .agg.result)' %t &&
+// RUN: grep 'define void @f38(.struct.s38. noalias sret .agg.result)' %t
struct s38 { char a[3]; short b; } f38(void) { while (1) {} }
-// RUN: grep 'define void @f39(.struct.s39. byval align 16 .x)' %t &&
+// RUN: grep 'define void @f39(.struct.s39. byval align 16 .x)' %t
typedef int v39 __attribute((vector_size(16)));
struct s39 { v39 x; };
void f39(struct s39 x) {}
// <rdar://problem/7247671>
-// RUN: grep 'define i32 @f40()' %t &&
+// RUN: grep 'define i32 @f40()' %t
enum e40 { ec0 = 0 };
enum e40 f40(void) { }
-// RUN: grep 'define void ()\* @f41()' %t &&
+// RUN: grep 'define void ()\* @f41()' %t
typedef void (^vvbp)(void);
vvbp f41(void) { }
-// RUN: grep 'define i32 @f42()' %t &&
+// RUN: grep 'define i32 @f42()' %t
struct s42 { enum e40 f0; } f42(void) { }
-// RUN: grep 'define i64 @f43()' %t &&
+// RUN: grep 'define i64 @f43()' %t
struct s43 { enum e40 f0; int f1; } f43(void) { }
-// RUN: grep 'define i32 @f44()' %t &&
+// RUN: grep 'define i32 @f44()' %t
struct s44 { vvbp f0; } f44(void) { }
-// RUN: grep 'define i64 @f45()' %t &&
+// RUN: grep 'define i64 @f45()' %t
struct s45 { vvbp f0; int f1; } f45(void) { }
-// RUN: grep 'define void @f46(i32 %a0)' %t &&
+// RUN: grep 'define void @f46(i32 %a0)' %t
void f46(enum e40 a0) { }
-// RUN: grep 'define void @f47(void ()\* %a1)' %t &&
+// RUN: grep 'define void @f47(void ()\* %a1)' %t
void f47(vvbp a1) { }
-// RUN: grep 'define void @f48(i32 %a0.0)' %t &&
+// RUN: grep 'define void @f48(i32 %a0.0)' %t
struct s48 { enum e40 f0; };
void f48(struct s48 a0) { }
-// RUN: grep 'define void @f49(i32 %a0.0, i32 %a0.1)' %t &&
+// RUN: grep 'define void @f49(i32 %a0.0, i32 %a0.1)' %t
struct s49 { enum e40 f0; int f1; };
void f49(struct s49 a0) { }
-// RUN: grep 'define void @f50(void ()\* %a0.0)' %t &&
+// RUN: grep 'define void @f50(void ()\* %a0.0)' %t
struct s50 { vvbp f0; };
void f50(struct s50 a0) { }
-// RUN: grep 'define void @f51(void ()\* %a0.0, i32 %a0.1)' %t &&
+// RUN: grep 'define void @f51(void ()\* %a0.0, i32 %a0.1)' %t
struct s51 { vvbp f0; int f1; };
void f51(struct s51 a0) { }
-// RUN: true
diff --git a/test/CodeGen/x86_64-arguments.c b/test/CodeGen/x86_64-arguments.c
index 19f9cdaa2918..1a848ead356f 100644
--- a/test/CodeGen/x86_64-arguments.c
+++ b/test/CodeGen/x86_64-arguments.c
@@ -1,15 +1,15 @@
-// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: grep 'define signext i8 @f0()' %t &&
-// RUN: grep 'define signext i16 @f1()' %t &&
-// RUN: grep 'define i32 @f2()' %t &&
-// RUN: grep 'define float @f3()' %t &&
-// RUN: grep 'define double @f4()' %t &&
-// RUN: grep 'define x86_fp80 @f5()' %t &&
-// RUN: grep 'define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8\* %a4)' %t &&
-// RUN: grep 'define void @f7(i32 %a0)' %t &&
-// RUN: grep '.0 = type { i64, double }' %t &&
-// RUN: grep 'define .0 @f8_1()' %t &&
-// RUN: grep 'define void @f8_2(.0)' %t &&
+// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o %t %s
+// RUN: grep 'define signext i8 @f0()' %t
+// RUN: grep 'define signext i16 @f1()' %t
+// RUN: grep 'define i32 @f2()' %t
+// RUN: grep 'define float @f3()' %t
+// RUN: grep 'define double @f4()' %t
+// RUN: grep 'define x86_fp80 @f5()' %t
+// RUN: grep 'define void @f6(i8 signext %a0, i16 signext %a1, i32 %a2, i64 %a3, i8\* %a4)' %t
+// RUN: grep 'define void @f7(i32 %a0)' %t
+// RUN: grep '.0 = type { i64, double }' %t
+// RUN: grep 'define .0 @f8_1()' %t
+// RUN: grep 'define void @f8_2(.0)' %t
char f0(void) {
return 0;
@@ -51,49 +51,48 @@ union u8 {
union u8 f8_1() { while (1) {} }
void f8_2(union u8 a0) {}
-// RUN: grep 'define i64 @f9()' %t &&
+// RUN: grep 'define i64 @f9()' %t
struct s9 { int a; int b; int : 0; } f9(void) { while (1) {} }
-// RUN: grep 'define void @f10(i64)' %t &&
+// RUN: grep 'define void @f10(i64)' %t
struct s10 { int a; int b; int : 0; };
void f10(struct s10 a0) {}
-// RUN: grep 'define void @f11(.union.anon. noalias sret .agg.result)' %t &&
+// RUN: grep 'define void @f11(.union.anon. noalias sret .agg.result)' %t
union { long double a; float b; } f11() { while (1) {} }
-// RUN: grep 'define i64 @f12_0()' %t &&
-// RUN: grep 'define void @f12_1(i64)' %t &&
+// RUN: grep 'define i64 @f12_0()' %t
+// RUN: grep 'define void @f12_1(i64)' %t
struct s12 { int a __attribute__((aligned(16))); };
struct s12 f12_0(void) { while (1) {} }
void f12_1(struct s12 a0) {}
// Check that sret parameter is accounted for when checking available integer
// registers.
-// RUN: grep 'define void @f13(.struct.s13_0. noalias sret .agg.result, i32 .a, i32 .b, i32 .c, i32 .d, .struct.s13_1. byval .e, i32 .f)' %t &&
+// RUN: grep 'define void @f13(.struct.s13_0. noalias sret .agg.result, i32 .a, i32 .b, i32 .c, i32 .d, .struct.s13_1. byval .e, i32 .f)' %t
struct s13_0 { long long f0[3]; };
struct s13_1 { long long f0[2]; };
struct s13_0 f13(int a, int b, int c, int d,
struct s13_1 e, int f) { while (1) {} }
-// RUN: grep 'define void @f14(.*, i8 signext .X)' %t &&
+// RUN: grep 'define void @f14(.*, i8 signext .X)' %t
void f14(int a, int b, int c, int d, int e, int f,
char X) {}
-// RUN: grep 'define void @f15(.*, i8\* .X)' %t &&
+// RUN: grep 'define void @f15(.*, i8\* .X)' %t
void f15(int a, int b, int c, int d, int e, int f,
void *X) {}
-// RUN: grep 'define void @f16(.*, float .X)' %t &&
+// RUN: grep 'define void @f16(.*, float .X)' %t
void f16(float a, float b, float c, float d, float e, float f, float g, float h,
float X) {}
-// RUN: grep 'define void @f17(.*, x86_fp80 .X)' %t &&
+// RUN: grep 'define void @f17(.*, x86_fp80 .X)' %t
void f17(float a, float b, float c, float d, float e, float f, float g, float h,
long double X) {}
// Check for valid coercion.
-// RUN: grep '.. = bitcast i64. .* to .struct.f18_s0.' %t &&
-// RUN: grep '.. = load .struct.f18_s0. .., align 1' %t &&
-// RUN: grep 'store .struct.f18_s0 .., .struct.f18_s0. .f18_arg1' %t &&
+// RUN: grep '.. = bitcast i64. .* to .struct.f18_s0.' %t
+// RUN: grep '.. = load .struct.f18_s0. .., align 1' %t
+// RUN: grep 'store .struct.f18_s0 .., .struct.f18_s0. .f18_arg1' %t
struct f18_s0 { int f0; };
void f18(int a, struct f18_s0 f18_arg1) { while (1) {} }
-// RUN: true