1 // RUN: %clang_cc1 -fsyntax-only -fblocks %s -verify
3 #define SUPPRESS1 __attribute__((suppress))
4 #define SUPPRESS2(...) __attribute__((suppress(__VA_ARGS__)))
6 SUPPRESS1 int global = 42;
9 SUPPRESS1 int *p; // no-warning
11 SUPPRESS1 int a = 0; // no-warning
13 int b = 1; // no-warning
15 int c = a + b; // no-warning
16 SUPPRESS2("a", "b") { b = c - a; } // no-warning
21 SUPPRESS1 while (1) {} // no-warning
22 SUPPRESS1 switch (a) { // no-warning
27 // GNU-style attributes and C++11 attributes apply to different things when
28 // written like this. GNU attribute gets attached to the declaration, while
29 // C++11 attribute ends up on the type.
30 int SUPPRESS2("r") z; // no-warning
31 SUPPRESS2(foo) // no-warning
33 // expected-error@-2 {{expected string literal as argument of 'suppress' attribute}}
36 union SUPPRESS2("type.1") U { // no-warning
41 SUPPRESS1 @interface Test { // no-warning
43 @property SUPPRESS2("prop") int *prop; // no-warning
44 - (void)bar:(int)x SUPPRESS1; // no-warning