Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / no-opt-volatile-memcpy.c
blob572b1faa11d5bd3084d26f2b6d50a89e93c118b6
1 // RUN: %clang_cc1 -triple=x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
3 struct s {
4 char filler [128];
5 volatile int x;
6 };
8 struct s gs;
10 void foo (void) {
11 struct s ls;
12 ls = ls;
13 gs = gs;
14 ls = gs;
16 // CHECK-LABEL: define{{.*}} void @foo()
17 // CHECK: %[[LS:.*]] = alloca %struct.s, align 4
18 // CHECK-NEXT: call void @llvm.memcpy.{{.*}}(ptr align 4 %[[LS]], ptr align 4 %[[LS]], i64 132, i1 true)
19 // CHECK-NEXT: call void @llvm.memcpy.{{.*}}(ptr align 4 @gs, ptr align 4 @gs, i64 132, i1 true)
20 // CHECK-NEXT: call void @llvm.memcpy.{{.*}}(ptr align 4 %[[LS]], ptr align 4 @gs, i64 132, i1 true)
23 struct s1 {
24 struct s y;
27 struct s1 s;
29 void fee (void) {
30 s = s;
31 s.y = gs;
33 // CHECK-LABEL: define{{.*}} void @fee()
34 // CHECK: call void @llvm.memcpy.{{.*}}(ptr align 4 @s, ptr align 4 @s, i64 132, i1 true)
35 // CHECK-NEXT: call void @llvm.memcpy.{{.*}}(ptr align 4 @s, ptr align 4 @gs, i64 132, i1 true)