1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -O3 | FileCheck -check-prefix CHECK-LP64 %s 2 // RUN: %clang_cc1 %s -triple=i386-apple-darwin10 -emit-llvm -o - -O3 | FileCheck -check-prefix CHECK-LP32 %s 3 4 // CHECK-LP64: %union.Test1 = type { i32, [4 x i8] } 5 union Test1 { 6 int a; 7 int b: 39; 8 } t1; 9 10 // CHECK-LP64: %union.Test2 = type { i8 } 11 union Test2 { 12 int : 6; 13 } t2; 14 15 // CHECK-LP64: %union.Test3 = type { i16 } 16 union Test3 { 17 int : 9; 18 } t3; 19 20 21 #define CHECK(x) if (!(x)) return __LINE__ 22 23 int f() { 24 struct { 25 int a; 26 27 unsigned long long b : 65; 28 29 int c; 30 } c; 31 32 c.a = 0; 33 c.b = (unsigned long long)-1; 34 c.c = 0; 35 36 CHECK(c.a == 0); 37 CHECK(c.b == (unsigned long long)-1); 38 CHECK(c.c == 0); 39 40 // CHECK-LP64: ret i32 0 41 // CHECK-LP32: ret i32 0 42 return 0; 43 } 44