blob: 13ea84f7bae92d5e6a3a6409557ce2c0aa24b452 [file] [log] [blame]
Daniel Dunbar45983252009-09-07 19:25:54 +00001// RUN: %llvmgcc_only %s -c -o /dev/null |& \
Stuart Hastingsba31be02009-03-10 00:17:39 +00002// RUN: egrep {(14|15|22): warning:} | \
3// RUN: wc -l | grep --quiet 3
Duncan Sands7edee122009-03-25 16:43:59 +00004// XTARGET: darwin,linux
Stuart Hastingsf50f8c02009-03-10 16:44:45 +00005// XFAIL: *
Stuart Hastingsba31be02009-03-10 00:17:39 +00006// END.
7// Insist upon warnings for inappropriate weak attributes.
8// Note the line numbers (14|15|22) embedded in the check.
9
10// O.K.
11extern int ext_weak_import __attribute__ ((__weak_import__));
12
13// These are inappropriate, and should generate warnings:
14int decl_weak_import __attribute__ ((__weak_import__));
15int decl_initialized_weak_import __attribute__ ((__weak_import__)) = 13;
16
17// O.K.
18extern int ext_f(void) __attribute__ ((__weak_import__));
19
20// These are inappropriate, and should generate warnings:
21int def_f(void) __attribute__ ((__weak_import__));
22int __attribute__ ((__weak_import__)) decl_f(void) {return 0;};