blob: 18d0d318ef828138e1e78cae001d4a2102be02f4 [file] [log] [blame]
John McCall83fe49d2010-11-14 09:40:28 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
2
3void test0() {
Stephen Lin43622612013-08-15 06:47:53 +00004 // CHECK-LABEL: define void @test0()
John McCall83fe49d2010-11-14 09:40:28 +00005 // CHECK: [[F:%.*]] = alloca float
JF Bastien27dcbb22013-07-17 05:57:42 +00006 // CHECK-NEXT: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({ float, float }* @test0_v, i32 0, i32 0), align 4
7 // CHECK-NEXT: load volatile float* getelementptr inbounds ({{.*}} @test0_v, i32 0, i32 1), align 4
John McCall83fe49d2010-11-14 09:40:28 +00008 // CHECK-NEXT: store float [[REAL]], float* [[F]], align 4
9 // CHECK-NEXT: ret void
10 extern volatile _Complex float test0_v;
11 float f = (float) test0_v;
12}
13
14void test1() {
Stephen Lin43622612013-08-15 06:47:53 +000015 // CHECK-LABEL: define void @test1()
JF Bastien27dcbb22013-07-17 05:57:42 +000016 // CHECK: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0), align 4
17 // CHECK-NEXT: [[IMAG:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1), align 4
18 // CHECK-NEXT: store volatile float [[REAL]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0), align 4
19 // CHECK-NEXT: store volatile float [[IMAG]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1), align 4
John McCall83fe49d2010-11-14 09:40:28 +000020 // CHECK-NEXT: ret void
21 extern volatile _Complex float test1_v;
22 test1_v = test1_v;
23}