diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/CodeGen/no-opt-volatile-memcpy.c | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/CodeGen/no-opt-volatile-memcpy.c')
-rw-r--r-- | test/CodeGen/no-opt-volatile-memcpy.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/CodeGen/no-opt-volatile-memcpy.c b/test/CodeGen/no-opt-volatile-memcpy.c new file mode 100644 index 0000000..0fab363 --- /dev/null +++ b/test/CodeGen/no-opt-volatile-memcpy.c @@ -0,0 +1,40 @@ +// RUN: %clang_cc1 -O0 -triple=x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s +// rdar://11861085 + +struct s { + char filler [128]; + volatile int x; +}; + +struct s gs; + +void foo (void) { + struct s ls; + ls = ls; + gs = gs; + ls = gs; +} +// CHECK: define void @foo() +// CHECK: %[[LS:.*]] = alloca %struct.s, align 4 +// CHECK-NEXT: %[[ZERO:.*]] = bitcast %struct.s* %[[LS]] to i8* +// CHECK-NEXT: %[[ONE:.*]] = bitcast %struct.s* %[[LS]] to i8* +// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* %[[ZERO]], i8* %[[ONE]], i64 132, i32 4, i1 true) +// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.s* @gs, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true) +// CHECK-NEXT: %[[TWO:.*]] = bitcast %struct.s* %[[LS]] to i8* +// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* %[[TWO]], i8* getelementptr inbounds (%struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true) + + +struct s1 { + struct s y; +}; + +struct s1 s; + +void fee (void) { + s = s; + s.y = gs; +} +// CHECK: define void @fee() +// CHECK: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true) +// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* getelementptr inbounds (%struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* getelementptr inbounds (%struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i32 4, i1 true) + |