1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc
test0()3*f4a2713aSLionel Sambuc void test0() {
4*f4a2713aSLionel Sambuc // CHECK-LABEL: define void @test0()
5*f4a2713aSLionel Sambuc // CHECK: [[F:%.*]] = alloca float
6*f4a2713aSLionel Sambuc // CHECK-NEXT: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({ float, float }* @test0_v, i32 0, i32 0), align 4
7*f4a2713aSLionel Sambuc // CHECK-NEXT: load volatile float* getelementptr inbounds ({{.*}} @test0_v, i32 0, i32 1), align 4
8*f4a2713aSLionel Sambuc // CHECK-NEXT: store float [[REAL]], float* [[F]], align 4
9*f4a2713aSLionel Sambuc // CHECK-NEXT: ret void
10*f4a2713aSLionel Sambuc extern volatile _Complex float test0_v;
11*f4a2713aSLionel Sambuc float f = (float) test0_v;
12*f4a2713aSLionel Sambuc }
13*f4a2713aSLionel Sambuc
test1()14*f4a2713aSLionel Sambuc void test1() {
15*f4a2713aSLionel Sambuc // CHECK-LABEL: define void @test1()
16*f4a2713aSLionel Sambuc // CHECK: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0), align 4
17*f4a2713aSLionel Sambuc // CHECK-NEXT: [[IMAG:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1), align 4
18*f4a2713aSLionel Sambuc // CHECK-NEXT: store volatile float [[REAL]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0), align 4
19*f4a2713aSLionel Sambuc // CHECK-NEXT: store volatile float [[IMAG]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1), align 4
20*f4a2713aSLionel Sambuc // CHECK-NEXT: ret void
21*f4a2713aSLionel Sambuc extern volatile _Complex float test1_v;
22*f4a2713aSLionel Sambuc test1_v = test1_v;
23*f4a2713aSLionel Sambuc }
24