Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / no-opt-volatile-memcpy.cpp
blob1a52169d5a938103e029e1bed647690f0eb13020
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 @_Z3foov()
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 @_Z3feev()
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)
37 struct d : s1 {
40 d gd;
42 void gorf(void) {
43 gd = gd;
45 // CHECK-LABEL: define{{.*}} void @_Z4gorfv()
46 // CHECK: call void @llvm.memcpy.{{.*}}(ptr align 4 @gd, ptr align 4 @gd, i64 132, i1 true)