Daniel Dunbar | b88b4f7 | 2009-02-13 19:23:53 +0000 | [diff] [blame^] | 1 | // RUN: clang -verify -fsyntax-only %s |
2 | |||||
3 | struct __attribute__((used)) s { // expected-warning {{'used' attribute only applies to variable and function types}} | ||||
4 | int x; | ||||
5 | }; | ||||
6 | |||||
7 | int a __attribute__((used)); | ||||
8 | |||||
9 | static void __attribute__((used)) f0(void) { | ||||
10 | } | ||||
11 | |||||
12 | void f1() { | ||||
13 | static int a __attribute__((used)); | ||||
14 | int b __attribute__((used)); // expected-warning {{used attribute ignored}} | ||||
15 | } | ||||
16 | |||||
17 |