[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Lexer / gnu-flags.c
blob6c7bf9405ddf0a6968c54d637f697e32cf4d98ca
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE
2 // RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wgnu
3 // RUN: %clang_cc1 -fsyntax-only -verify %s -DALL \
4 // RUN: -Wgnu-zero-variadic-macro-arguments \
5 // RUN: -Wgnu-zero-line-directive
6 // RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wgnu \
7 // RUN: -Wno-gnu-zero-variadic-macro-arguments \
8 // RUN: -Wno-gnu-zero-line-directive
9 // Additional disabled tests:
10 // %clang_cc1 -fsyntax-only -verify %s -DZEROARGS -Wgnu-zero-variadic-macro-arguments
11 // %clang_cc1 -fsyntax-only -verify %s -DLINE0 -Wgnu-zero-line-directive
13 #if NONE
14 // expected-no-diagnostics
15 #endif
18 #if ALL || ZEROARGS
19 // expected-warning@+3 {{token pasting of ',' and __VA_ARGS__ is a GNU extension}}
20 #endif
22 #define efoo(format, args...) foo(format , ##args)
24 void foo( const char* c )
26 efoo("6");
30 // This case is handled differently because lit has a bug whereby #line 0 is reported to be on line 4294967295
31 // http://llvm.org/bugs/show_bug.cgi?id=16952
32 #if ALL || LINE0
33 #line 0 // expected-warning {{#line directive with zero argument is a GNU extension}}
34 #else
35 #line 0
36 #endif
38 // WARNING: Do not add more tests after the #line 0 line! Add them before the LINE0 test