]> git.proxmox.com Git - rustc.git/blob - src/llvm/tools/clang/test/CodeGen/ms_struct-bitfield-1.c
Imported Upstream version 0.6
[rustc.git] / src / llvm / tools / clang / test / CodeGen / ms_struct-bitfield-1.c
1 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-darwin9 %s
2 // rdar://8823265
3
4 #define ATTR __attribute__((__ms_struct__))
5
6 struct {
7 unsigned int bf_1 : 12;
8 unsigned int : 0;
9 unsigned int bf_2 : 12;
10 } ATTR t1;
11 static int a1[(sizeof(t1) == 8) -1];
12
13 struct
14 {
15 char foo : 4;
16 short : 0;
17 char bar;
18 } ATTR t2;
19 static int a2[(sizeof(t2) == 4) -1];
20
21 #pragma ms_struct on
22 struct
23 {
24 char foo : 4;
25 short : 0;
26 char bar;
27 } t3;
28 #pragma ms_struct off
29 static int a3[(sizeof(t3) == 4) -1];
30
31 struct
32 {
33 char foo : 6;
34 long : 0;
35 } ATTR t4;
36 static int a4[(sizeof(t4) == 8) -1];
37
38 struct
39 {
40 char foo : 4;
41 short : 0;
42 char bar : 8;
43 } ATTR t5;
44 static int a5[(sizeof(t5) == 4) -1];
45
46 struct
47 {
48 char foo : 4;
49 short : 0;
50 long : 0;
51 char bar;
52 } ATTR t6;
53 static int a6[(sizeof(t6) == 4) -1];
54
55 struct
56 {
57 char foo : 4;
58 long : 0;
59 short : 0;
60 char bar;
61 } ATTR t7;
62 static int a7[(sizeof(t7) == 16) -1];
63
64 struct
65 {
66 char foo : 4;
67 short : 0;
68 long : 0;
69 char bar:7;
70 } ATTR t8;
71 static int a8[(sizeof(t8) == 4) -1];
72
73 struct
74 {
75 char foo : 4;
76 long : 0;
77 short : 0;
78 char bar: 8;
79 } ATTR t9;
80 static int a9[(sizeof(t9) == 16) -1];
81
82 struct
83 {
84 char foo : 4;
85 char : 0;
86 short : 0;
87 int : 0;
88 long :0;
89 char bar;
90 } ATTR t10;
91 static int a10[(sizeof(t10) == 2) -1];