blob: accc7b620b5b0202b51f6f3698e2450096e96ad7 [file] [log] [blame]
Fariborz Jahanian767a1a22012-08-17 21:44:55 +00001// RUN: %clang_cc1 -verify -fsyntax-only -Wno-private-extern %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
Rafael Espindola4875bf22012-11-23 13:54:40 +000020static void __attribute__((used)) f0(void);