blob: f219de6b848fce2356ed1c1d8444bd7a7aef8542 [file] [log] [blame]
Eric Christopher5485ac02011-07-26 00:47:54 +00001// RUN: %clang_cc1 %s -triple i686-apple-darwin
2// Insist upon warnings for inappropriate weak attributes.
3
4// O.K.
5extern int ext_weak_import __attribute__ ((__weak_import__));
6
7// These are inappropriate, and should generate warnings:
8int decl_weak_import __attribute__ ((__weak_import__)); // expected-warning {'weak_import' attribute cannot be specified on a definition}
9int decl_initialized_weak_import __attribute__ ((__weak_import__)) = 13; // expected-warning {'weak_import' attribute cannot be specified on a definition}
10
11// O.K.
12extern int ext_f(void) __attribute__ ((__weak_import__));
13
14// These are inappropriate, and should generate warnings:
15int def_f(void) __attribute__ ((__weak_import__));
16int __attribute__ ((__weak_import__)) decl_f(void) {return 0;};