1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin10 | FileCheck %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc // This file tests the clang extension which allows initializing the components
4*f4a2713aSLionel Sambuc // of a complex number individually using an initialization list. (There is a
5*f4a2713aSLionel Sambuc // extensive description and test in test/Sema/complex-init-list.c.)
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc _Complex float x = { 1.0f, 1.0f/0.0f };
8*f4a2713aSLionel Sambuc // CHECK: @x = global { float, float } { float 1.000000e+00, float 0x7FF0000000000000 }, align 4
9*f4a2713aSLionel Sambuc
f(float x,float y)10*f4a2713aSLionel Sambuc _Complex float f(float x, float y) { _Complex float z = { x, y }; return z; }
11*f4a2713aSLionel Sambuc // CHECK-LABEL: define <2 x float> @f
12*f4a2713aSLionel Sambuc // CHECK: alloca { float, float }
13*f4a2713aSLionel Sambuc // CHECK: alloca { float, float }
14*f4a2713aSLionel Sambuc
f2(float x,float y)15*f4a2713aSLionel Sambuc _Complex float f2(float x, float y) { return (_Complex float){ x, y }; }
16*f4a2713aSLionel Sambuc // CHECK-LABEL: define <2 x float> @f2
17*f4a2713aSLionel Sambuc // CHECK: alloca { float, float }
18*f4a2713aSLionel Sambuc // CHECK: alloca { float, float }
19