blob: 490b7d776b9f54808aa226b1b8dba5d536f3ba45 [file] [log] [blame]
John McCallff624c12010-11-14 09:40:28 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
2
3void test0() {
4 // CHECK: define void @test0()
5 // CHECK: [[F:%.*]] = alloca float
Chris Lattner9cbe4f02011-07-09 17:41:47 +00006 // CHECK-NEXT: [[REAL:%.*]] = volatile load float* getelementptr inbounds ({ float, float }* @test0_v, i32 0, i32 0)
7 // CHECK-NEXT: volatile load float* getelementptr inbounds ({{.*}} @test0_v, i32 0, i32 1)
John McCallff624c12010-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() {
15 // CHECK: define void @test1()
Chris Lattner9cbe4f02011-07-09 17:41:47 +000016 // CHECK: [[REAL:%.*]] = volatile load float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0)
17 // CHECK-NEXT: [[IMAG:%.*]] = volatile load float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1)
18 // CHECK-NEXT: volatile store float [[REAL]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0)
19 // CHECK-NEXT: volatile store float [[IMAG]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1)
John McCallff624c12010-11-14 09:40:28 +000020 // CHECK-NEXT: ret void
21 extern volatile _Complex float test1_v;
22 test1_v = test1_v;
23}