minix/external/bsd/llvm/dist/clang/test/Sema/attr-used.c
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

20 lines
627 B
C

// 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);