41 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE2// RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wgnu3// RUN: %clang_cc1 -fsyntax-only -verify %s -DALL \4// RUN: -Wgnu-zero-variadic-macro-arguments \5// RUN: -Wgnu-zero-line-directive6// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wgnu \7// RUN: -Wno-gnu-zero-variadic-macro-arguments \8// RUN: -Wno-gnu-zero-line-directive9// Additional disabled tests:10// %clang_cc1 -fsyntax-only -verify %s -DZEROARGS -Wgnu-zero-variadic-macro-arguments11// %clang_cc1 -fsyntax-only -verify %s -DLINE0 -Wgnu-zero-line-directive12 13#if NONE14// expected-no-diagnostics15#endif16 17 18#if ALL || ZEROARGS19// expected-warning@+9 {{passing no argument for the '...' parameter of a variadic macro is a C23 extension}}20// expected-note@+4 {{macro 'efoo' defined here}}21// expected-warning@+3 {{token pasting of ',' and __VA_ARGS__ is a GNU extension}}22#endif23 24#define efoo(format, args...) foo(format , ##args)25 26void foo( const char* c )27{28 efoo("6");29}30 31 32// This case is handled differently because lit has a bug whereby #line 0 is reported to be on line 429496729533// http://llvm.org/bugs/show_bug.cgi?id=1695234#if ALL || LINE035#line 0 // expected-warning {{#line directive with zero argument is a GNU extension}}36#else37#line 038#endif39 40// WARNING: Do not add more tests after the #line 0 line! Add them before the LINE0 test41