summaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-04-02 08:55:10 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-04-02 08:55:10 +0000
commit07b2cfcdb817cc0790420f159a313d61e7241cb9 (patch)
treed374cdca417e76f1bf101f139dba2db1d10ee8f7 /test/CodeGen
parent1e255aab650a7fa2047fd953cae65b12215280af (diff)
downloadFreeBSD-src-07b2cfcdb817cc0790420f159a313d61e7241cb9.zip
FreeBSD-src-07b2cfcdb817cc0790420f159a313d61e7241cb9.tar.gz
Update clang to r100181.
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/atomic.c6
-rw-r--r--test/CodeGen/mangle.c4
-rw-r--r--test/CodeGen/palignr.c2
-rw-r--r--test/CodeGen/regparm.c11
-rw-r--r--test/CodeGen/restrict.c26
5 files changed, 41 insertions, 8 deletions
diff --git a/test/CodeGen/atomic.c b/test/CodeGen/atomic.c
index c201a1a..aa5aa15 100644
--- a/test/CodeGen/atomic.c
+++ b/test/CodeGen/atomic.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin9 > %t1
-// RUN: grep @llvm.memory.barrier %t1 | count 42
+// RUN: grep @llvm.memory.barrier %t1 | count 38
// 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
@@ -8,7 +8,7 @@
// 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.and.i32 %t1
// RUN: grep @llvm.atomic.load.or.i8 %t1
// RUN: grep @llvm.atomic.load.xor.i8 %t1
@@ -34,14 +34,12 @@ int atomic(void)
old = __sync_fetch_and_and(&val, 0x9);
old = __sync_fetch_and_or(&val, 0xa);
old = __sync_fetch_and_xor(&val, 0xb);
- old = __sync_fetch_and_nand(&val, 0xb);
old = __sync_add_and_fetch(&val, 1);
old = __sync_sub_and_fetch(&val, 2);
old = __sync_and_and_fetch(&valc, 3);
old = __sync_or_and_fetch(&valc, 4);
old = __sync_xor_and_fetch(&valc, 5);
- old = __sync_nand_and_fetch(&valc, 5);
__sync_val_compare_and_swap((void **)0, (void *)0, (void *)0);
diff --git a/test/CodeGen/mangle.c b/test/CodeGen/mangle.c
index a087b42..93d424a 100644
--- a/test/CodeGen/mangle.c
+++ b/test/CodeGen/mangle.c
@@ -59,3 +59,7 @@ extern int func (void) __asm__ ("FUNC");
int func(void) {
return 42;
}
+
+// CHECK: @_Z4foo9Dv4_f
+typedef __attribute__(( vector_size(16) )) float float4;
+void __attribute__((__overloadable__)) foo9(float4 f) {}
diff --git a/test/CodeGen/palignr.c b/test/CodeGen/palignr.c
index 68efb41..627e309 100644
--- a/test/CodeGen/palignr.c
+++ b/test/CodeGen/palignr.c
@@ -15,5 +15,5 @@ int4 align1(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 15); }
int4 align2(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 16); }
// CHECK: psrldq
int4 align3(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 17); }
-// CHECK: xorps
+// CHECK: xor
int4 align4(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 32); }
diff --git a/test/CodeGen/regparm.c b/test/CodeGen/regparm.c
index ac37975..b60f8c7 100644
--- a/test/CodeGen/regparm.c
+++ b/test/CodeGen/regparm.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | grep inreg | count 2
+// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
#define FASTCALL __attribute__((regparm(2)))
@@ -8,11 +8,16 @@ typedef struct {
int ccc[200];
} foo;
+typedef void (*FType)(int, int) __attribute ((regparm (3), stdcall));
+FType bar;
+
static void FASTCALL
-reduced(char b, double c, foo* d, double e, int f) {
-}
+reduced(char b, double c, foo* d, double e, int f);
int
main(void) {
+ // CHECK: call void @reduced(i8 signext inreg 0, {{.*}} %struct.anon* inreg null
reduced(0, 0.0, 0, 0.0, 0);
+ // CHECK: call x86_stdcallcc void {{.*}}(i32 inreg 1, i32 inreg 2)
+ bar(1,2);
}
diff --git a/test/CodeGen/restrict.c b/test/CodeGen/restrict.c
new file mode 100644
index 0000000..8bbff24
--- /dev/null
+++ b/test/CodeGen/restrict.c
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -triple x86_64-darwin-apple -emit-llvm %s -o - | FileCheck %s
+
+// PR6695
+
+// CHECK: define void @test0(i32* %{{.*}}, i32 %{{.*}})
+void test0(int *x, int y) {
+}
+
+// CHECK: define void @test1(i32* noalias %{{.*}}, i32 %{{.*}})
+void test1(int * restrict x, int y) {
+}
+
+// CHECK: define void @test2(i32* %{{.*}}, i32* noalias %{{.*}})
+void test2(int *x, int * restrict y) {
+}
+
+typedef int * restrict rp;
+
+// CHECK: define void @test3(i32* noalias %{{.*}}, i32 %{{.*}})
+void test3(rp x, int y) {
+}
+
+// CHECK: define void @test4(i32* %{{.*}}, i32* noalias %{{.*}})
+void test4(int *x, rp y) {
+}
+
OpenPOWER on IntegriCloud