blob: 99c1c62b58844e6c50991a62267e322b6bfb1343 [file] [log] [blame]
Eli Friedman0c706c22011-09-19 23:17:44 +00001// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin10 | FileCheck %s
2
3// This file tests the clang extension which allows initializing the components
4// of a complex number individually using an initialization list. (There is a
5// extensive description and test in test/Sema/complex-init-list.c.)
6
7_Complex float x = { 1.0f, 1.0f/0.0f };
8// CHECK: @x = global { float, float } { float 1.000000e+00, float 0x7FF0000000000000 }, align 4
9
10_Complex float f(float x, float y) { _Complex float z = { x, y }; return z; }
11// CHECK: define <2 x float> @f
Eli Friedmanfce47152012-02-27 20:26:13 +000012// CHECK: alloca { float, float }
13// CHECK: alloca { float, float }
14
15_Complex float f2(float x, float y) { return (_Complex float){ x, y }; }
16// CHECK: define <2 x float> @f2
17// CHECK: alloca { float, float }
18// CHECK: alloca { float, float }