1// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -O3 | FileCheck -check-prefix LP64 %s
2// RUN: %clang_cc1 %s -triple=i386-apple-darwin10 -emit-llvm -o - -O3 | FileCheck -check-prefix LP32 %s
3
4// CHECK-LP64: %union.Test1 = type { i32, [4 x i8] }
5union Test1 {
6  int a;
7  int b: 39;
8} t1;
9
10// CHECK-LP64: %union.Test2 = type { i8 }
11union Test2 {
12  int : 6;
13} t2;
14
15// CHECK-LP64: %union.Test3 = type { [2 x i8] }
16union Test3 {
17  int : 9;
18} t3;
19
20
21#define CHECK(x) if (!(x)) return __LINE__
22
23int 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