[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / volatile-2.c
blob47a4bc347cda51b724c150dd3c8e058aec0569b6
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
3 void test0(void) {
4 // CHECK-LABEL: define{{.*}} void @test0()
5 // CHECK: [[F:%.*]] = alloca float
6 // CHECK-NEXT: [[REAL:%.*]] = load volatile float, ptr @test0_v, align 4
7 // CHECK-NEXT: load volatile float, ptr getelementptr inbounds nuw ({{.*}} @test0_v, i32 0, i32 1), align 4
8 // CHECK-NEXT: store float [[REAL]], ptr [[F]], align 4
9 // CHECK-NEXT: ret void
10 extern volatile _Complex float test0_v;
11 float f = (float) test0_v;
14 void test1(void) {
15 // CHECK-LABEL: define{{.*}} void @test1()
16 // CHECK: [[REAL:%.*]] = load volatile float, ptr @test1_v, align 4
17 // CHECK-NEXT: [[IMAG:%.*]] = load volatile float, ptr getelementptr inbounds nuw ({{.*}} @test1_v, i32 0, i32 1), align 4
18 // CHECK-NEXT: store volatile float [[REAL]], ptr @test1_v, align 4
19 // CHECK-NEXT: store volatile float [[IMAG]], ptr getelementptr inbounds nuw ({{.*}} @test1_v, i32 0, i32 1), align 4
20 // CHECK-NEXT: ret void
21 extern volatile _Complex float test1_v;
22 test1_v = test1_v;