• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -emit-llvm-only -triple armv7-apple-darwin -fdump-record-layouts %s 2>/dev/null \
2 // RUN:            | FileCheck %s
3 
4 // rdar://22275433
5 
6 #pragma ms_struct on
7 
8 union A {
9   unsigned long long x : 32;
10   unsigned long long y : 32;
11 } a;
12 // CHECK:*** Dumping AST Record Layout
13 // CHECK-NEXT:        0 | union A
14 // CHECK-NEXT:   0:0-31 |   unsigned long long x
15 // CHECK-NEXT:   0:0-31 |   unsigned long long y
16 // CHECK-NEXT:          | [sizeof=8, align=1]
17 
18 union B {
19   __attribute__((aligned(4)))
20   unsigned long long x : 32;
21   unsigned long long y : 32;
22 } b;
23 // CHECK:*** Dumping AST Record Layout
24 // CHECK-NEXT:       0 | union B
25 // CHECK-NEXT:  0:0-31 |   unsigned long long x
26 // CHECK-NEXT:  0:0-31 |   unsigned long long y
27 // CHECK-NEXT:         | [sizeof=8, align=1]
28 
29 union C {
30   unsigned long long : 0;
31   unsigned short y : 8;
32 } c;
33 // CHECK:*** Dumping AST Record Layout
34 // CHECK-NEXT:       0 | union C
35 // CHECK-NEXT:     0:- |   unsigned long long
36 // CHECK-NEXT:   0:0-7 |   unsigned short y
37 // CHECK-NEXT:         | [sizeof=2, align=1]
38 
39 union D {
40   unsigned long long : 0;
41   unsigned short : 0;
42 } d;
43 // CHECK:*** Dumping AST Record Layout
44 // CHECK-NEXT:       0 | union D
45 // CHECK-NEXT:     0:- |   unsigned long long
46 // CHECK-NEXT:     0:- |   unsigned short
47 // CHECK-NEXT:         | [sizeof=1, align=1]
48 
49