1 // RUN: %clang_cc1 -Wfinal-macro %s -fsyntax-only -isystem %S/Inputs -verify
3 // Test warning production
5 // expected-note@+1 4{{macro marked 'final' here}}
6 #pragma clang final(Foo)
8 // expected-warning@+2{{macro 'Foo' has been marked as final and should not be redefined}}
9 // expected-note@+1{{previous definition is here}}
12 // expected-warning@+2{{macro 'Foo' has been marked as final and should not be redefined}}
13 // expected-warning@+1{{'Foo' macro redefined}}
16 // expected-warning@+1{{redefining builtin macro}}
19 // expected-warning@+1{{undefining builtin macro}}
22 // expected-warning@+1{{macro 'Foo' has been marked as final and should not be undefined}}
24 // expected-warning@+1{{macro 'Foo' has been marked as final and should not be redefined}}
28 // expected-error@+1{{expected (}}
31 // expected-error@+1{{expected )}}
32 #pragma clang final(Foo
34 // expected-error@+1{{no macro named 'Baz'}}
35 #pragma clang final(Baz)
37 // expected-error@+1{{expected identifier}}
38 #pragma clang final(4)
40 // expected-error@+1{{expected (}}
41 #pragma clang final Baz
43 // no diagnostics triggered by these pragmas.
44 #pragma clang deprecated(Foo)
45 #pragma clang restrict_expansion(Foo)
47 #define SYSTEM_MACRO Woah
48 // expected-note@+1 2{{macro marked 'final' here}}
49 #pragma clang final(SYSTEM_MACRO)
50 #include <final-macro-system.h>