aboutsummaryrefslogtreecommitdiff
path: root/test/FrontendC/2009-03-09-WeakDeclarations-1.c
blob: a0b7efbfef248e701d47085d19e180f4cad8c117 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: $llvmgcc $test -c -o /dev/null |& \
// RUN: egrep {(14|15|22): warning:} |	\
// RUN: wc -l | grep --quiet 3
// TARGET: *-*-darwin
// XFAIL: alpha|ia64|sparc
// END.
// Insist upon warnings for inappropriate weak attributes.
// Note the line numbers (14|15|22) embedded in the check.

// O.K.
extern int ext_weak_import __attribute__ ((__weak_import__));

// These are inappropriate, and should generate warnings:
int decl_weak_import __attribute__ ((__weak_import__));
int decl_initialized_weak_import __attribute__ ((__weak_import__)) = 13;

// O.K.
extern int ext_f(void) __attribute__ ((__weak_import__));

// These are inappropriate, and should generate warnings:
int def_f(void) __attribute__ ((__weak_import__));
int __attribute__ ((__weak_import__)) decl_f(void) {return 0;};