blob: 08388169247e5ae9c0daf2ddec53252f83c3efd1 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -verify -fsyntax-only %s
Daniel Dunbarb805dad2009-02-13 19:23:53 +00002
Daniel Dunbar186204b2009-02-13 22:48:56 +00003extern int l0 __attribute__((used)); // expected-warning {{used attribute ignored}}
4__private_extern__ int l1 __attribute__((used)); // expected-warning {{used attribute ignored}}
5
John McCalld6b8de02011-01-25 03:51:08 +00006struct __attribute__((used)) s { // expected-warning {{'used' attribute only applies to variables and functions}}
Daniel Dunbarb805dad2009-02-13 19:23:53 +00007 int x;
8};
9
10int a __attribute__((used));
11
12static void __attribute__((used)) f0(void) {
13}
14
15void f1() {
16 static int a __attribute__((used));
17 int b __attribute__((used)); // expected-warning {{used attribute ignored}}
18}
19
20