[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / override-layout.cpp
blobfea2a45c6299d0d8441bad7271775eef3564a67d
1 // RUN: %clang_cc1 -w -fdump-record-layouts-simple %s > %t.layouts
2 // RUN: %clang_cc1 -w -fdump-record-layouts-simple %s > %t.before
3 // RUN: %clang_cc1 -w -DPACKED= -DALIGNED16= -fdump-record-layouts-simple -foverride-record-layout=%t.layouts %s > %t.after
4 // RUN: diff -u %t.before %t.after
5 // RUN: FileCheck %s < %t.after
7 // If not explicitly disabled, set PACKED to the packed attribute.
8 #ifndef PACKED
9 # define PACKED __attribute__((packed))
10 #endif
12 struct Empty1 { };
13 struct Empty2 { };
15 // CHECK: Type: struct X0
16 struct X0 : public Empty1 {
17 int x[6] PACKED;
20 // CHECK: Type: struct X1
21 struct X1 : public X0, public Empty2 {
22 char x[13];
23 struct X0 y;
24 } PACKED;
26 // CHECK: Type: struct X2
27 struct PACKED X2 : public X1, public X0, public Empty1 {
28 short x;
29 int y;
32 // CHECK: Type: struct X3
33 struct PACKED X3 : virtual public X1, public X0 {
34 short x;
35 int y;
38 // CHECK: Type: struct X4
39 struct PACKED X4 {
40 unsigned int a : 1;
41 unsigned int b : 1;
42 unsigned int c : 1;
43 unsigned int d : 1;
44 unsigned int e : 1;
45 unsigned int f : 1;
46 unsigned int g : 1;
47 unsigned int h : 1;
48 unsigned int i : 1;
49 unsigned int j : 1;
50 unsigned int k : 1;
51 unsigned int l : 1;
52 unsigned int m : 1;
53 unsigned int n : 1;
54 X4();
57 // CHECK: Type: struct X5
58 struct PACKED X5 {
59 union {
60 long a;
61 long b;
63 short l;
64 short r;
67 // CHECK: Type: struct X6
68 struct __attribute__((aligned(16))) X6 {
69 int x;
70 int y;
71 virtual ~X6();
74 // CHECK: Type: struct X7
75 struct X7 {
76 int z;
79 // CHECK: Type: struct X8
80 struct X8 : X6, virtual X7 {
81 char c;
84 void use_structs() {
85 X0 x0s[sizeof(X0)];
86 X1 x1s[sizeof(X1)];
87 X2 x2s[sizeof(X2)];
88 X3 x3s[sizeof(X3)];
89 X4 x4s[sizeof(X4)];
90 X5 x5s[sizeof(X5)];
91 X6 x6s[sizeof(X6)];
92 X7 x7s[sizeof(X7)];
93 X8 x8s[sizeof(X8)];
94 x4s[1].a = 1;
95 x5s[1].a = 17;