Move variable that's unused in an NDEBUG build inside the DEBUG() macro, fixing
[llvm.git] / test / FrontendC / 2009-03-09-WeakDeclarations-1.c
blob13ea84f7bae92d5e6a3a6409557ce2c0aa24b452
1 // RUN: %llvmgcc_only %s -c -o /dev/null |& \
2 // RUN: egrep {(14|15|22): warning:} | \
3 // RUN: wc -l | grep --quiet 3
4 // XTARGET: darwin,linux
5 // XFAIL: *
6 // END.
7 // Insist upon warnings for inappropriate weak attributes.
8 // Note the line numbers (14|15|22) embedded in the check.
10 // O.K.
11 extern int ext_weak_import __attribute__ ((__weak_import__));
13 // These are inappropriate, and should generate warnings:
14 int decl_weak_import __attribute__ ((__weak_import__));
15 int decl_initialized_weak_import __attribute__ ((__weak_import__)) = 13;
17 // O.K.
18 extern int ext_f(void) __attribute__ ((__weak_import__));
20 // These are inappropriate, and should generate warnings:
21 int def_f(void) __attribute__ ((__weak_import__));
22 int __attribute__ ((__weak_import__)) decl_f(void) {return 0;};