// RUN: %clang_cc1 -verify -fsyntax-only -Wno-private-extern %s

extern int l0 __attribute__((used)); // expected-warning {{used attribute ignored}}
__private_extern__ int l1 __attribute__((used)); // expected-warning {{used attribute ignored}}

struct __attribute__((used)) s { // expected-warning {{'used' attribute only applies to variables and functions}}
  int x;
};

int a __attribute__((used));

static void __attribute__((used)) f0(void) {
}

void f1() {
  static int a __attribute__((used)); 
  int b __attribute__((used)); // expected-warning {{used attribute ignored}}
}



// RUN: %clang_cc1 -verify -fsyntax-only -Wno-private-extern %s

extern int l0 __attribute__((used)); // expected-warning {{used attribute ignored}}
__private_extern__ int l1 __attribute__((used)); // expected-warning {{used attribute ignored}}

struct __attribute__((used)) s { // expected-warning {{'used' attribute only applies to variables and functions}}
  int x;
};

int a __attribute__((used));

static void __attribute__((used)) f0(void) {
}

void f1() {
  static int a __attribute__((used)); 
  int b __attribute__((used)); // expected-warning {{used attribute ignored}}
}

static void __attribute__((used)) f0(void);

Check that we don't warn on this testcase. This is basically a test that Decl::isUsed checks the attribute. If the function had a body just the check is DeclMustBeEmitted would be sufficient.
Check that we don't warn on this testcase. This is basically a test that
Decl::isUsed checks the attribute. If the function had a body just the check
is DeclMustBeEmitted would be sufficient.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@168514 91177308-0d34-0410-b5e6-96231b3b80d8
