John McCall | ff624c1 | 2010-11-14 09:40:28 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s |
| 2 | |
| 3 | void test0() { |
| 4 | // CHECK: define void @test0() |
| 5 | // CHECK: [[F:%.*]] = alloca float |
Eli Friedman | a40b7f2 | 2011-08-12 23:33:52 +0000 | [diff] [blame] | 6 | // CHECK-NEXT: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({ float, float }* @test0_v, i32 0, i32 0) |
| 7 | // CHECK-NEXT: load volatile float* getelementptr inbounds ({{.*}} @test0_v, i32 0, i32 1) |
John McCall | ff624c1 | 2010-11-14 09:40:28 +0000 | [diff] [blame] | 8 | // 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 | |
| 14 | void test1() { |
| 15 | // CHECK: define void @test1() |
Eli Friedman | a40b7f2 | 2011-08-12 23:33:52 +0000 | [diff] [blame] | 16 | // CHECK: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0) |
| 17 | // CHECK-NEXT: [[IMAG:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1) |
| 18 | // CHECK-NEXT: store volatile float [[REAL]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0) |
| 19 | // CHECK-NEXT: store volatile float [[IMAG]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1) |
John McCall | ff624c1 | 2010-11-14 09:40:28 +0000 | [diff] [blame] | 20 | // CHECK-NEXT: ret void |
| 21 | extern volatile _Complex float test1_v; |
| 22 | test1_v = test1_v; |
| 23 | } |