[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Parser / pragma-pack.c
blobd2aefaa888f473f9262d4cfbae92525edb3fbbba
1 // RUN: %clang_cc1 -fsyntax-only -Wno-pragma-pack -verify %s
3 // Note that this puts the expected lines before the directives to work around
4 // limitations in the -verify mode.
6 /* expected-warning {{missing '(' after '#pragma pack'}}*/ #pragma pack 10
7 #pragma pack()
8 #pragma pack(8)
10 /*expected-warning {{unknown action for '#pragma pack'}}*/ #pragma pack(hello)
11 #pragma pack(push)
12 #pragma pack(pop)
14 /* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(push,)
15 /* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(push,)
16 /* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(pop,)
18 #pragma pack(push,i)
19 /* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(push,i,
20 /* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(push,i,)
21 /* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ #pragma pack(push,i,help)
23 #pragma pack(push,8)
24 /* expected-warning {{missing ')' after '#pragma pack'}}*/ #pragma pack(push,8,
25 /* expected-warning {{missing ')' after '#pragma pack'}}*/ #pragma pack(push,8,)
26 /* expected-warning {{missing ')' after '#pragma pack'}}*/ #pragma pack(push,i,8
27 #pragma pack(push,i,8)
29 /* expected-warning {{missing ')' after '#pragma pack'}}*/ #pragma pack(push
31 _Pragma("pack(push)")
32 /* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ _Pragma("pack(push,)")
34 // PR13580
35 struct S
37 char a[3];
38 #pragma pack(1)
39 struct T
41 char b;
42 int c;
43 } d;
44 #pragma pack()
45 int e;
48 _Pragma("pack(push, 1)") struct PR28094 {
49 int a;
50 } _Pragma("pack(pop)");