Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Preprocessor / Weverything_pragma.c
blob5300e7aebf46443f03ca66e4314c163cde8d78f5
1 // RUN: %clang_cc1 -Weverything -fsyntax-only -verify %s
3 // Test that the pragma overrides command line option -Weverythings,
5 // a diagnostic with DefaultIgnore. This is part of a group 'unused-macro'
6 // but -Weverything forces it
7 #define UNUSED_MACRO1 1 // expected-warning{{macro is not used}}
9 void foo(void) // expected-warning {{no previous prototype for function}}
10 // expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
12 // A diagnostic without DefaultIgnore, and not part of a group.
13 (void) 'ab'; // expected-warning {{multi-character character constant}}
15 #pragma clang diagnostic warning "-Weverything" // Should not change anyhting.
16 #define UNUSED_MACRO2 1 // expected-warning{{macro is not used}}
17 (void) 'cd'; // expected-warning {{multi-character character constant}}
19 #pragma clang diagnostic ignored "-Weverything" // Ignore warnings now.
20 #define UNUSED_MACRO2 1 // no warning
21 (void) 'ef'; // no warning here
23 #pragma clang diagnostic warning "-Weverything" // Revert back to warnings.
24 #define UNUSED_MACRO3 1 // expected-warning{{macro is not used}}
25 (void) 'gh'; // expected-warning {{multi-character character constant}}
27 #pragma clang diagnostic error "-Weverything" // Give errors now.
28 #define UNUSED_MACRO4 1 // expected-error{{macro is not used}}
29 (void) 'ij'; // expected-error {{multi-character character constant}}