1f4a2713aSLionel Sambuc // RUN: %clang_cc1 -verify -fsyntax-only -Wno-private-extern %s 2f4a2713aSLionel Sambuc 3*0a6a1f1dSLionel Sambuc extern int l0 __attribute__((used)); // expected-warning {{'used' attribute ignored}} 4*0a6a1f1dSLionel Sambuc __private_extern__ int l1 __attribute__((used)); // expected-warning {{'used' attribute ignored}} 5f4a2713aSLionel Sambuc 6f4a2713aSLionel Sambuc struct __attribute__((used)) s { // expected-warning {{'used' attribute only applies to variables and functions}} 7f4a2713aSLionel Sambuc int x; 8f4a2713aSLionel Sambuc }; 9f4a2713aSLionel Sambuc 10f4a2713aSLionel Sambuc int a __attribute__((used)); 11f4a2713aSLionel Sambuc f0(void)12f4a2713aSLionel Sambucstatic void __attribute__((used)) f0(void) { 13f4a2713aSLionel Sambuc } 14f4a2713aSLionel Sambuc f1()15f4a2713aSLionel Sambucvoid f1() { 16f4a2713aSLionel Sambuc static int a __attribute__((used)); 17*0a6a1f1dSLionel Sambuc int b __attribute__((used)); // expected-warning {{'used' attribute ignored}} 18f4a2713aSLionel Sambuc } 19f4a2713aSLionel Sambuc 20f4a2713aSLionel Sambuc static void __attribute__((used)) f0(void); 21