summaryrefslogtreecommitdiffstats
path: root/test/Sema/attr-weak.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-02 17:58:47 +0000
committered <ed@FreeBSD.org>2009-06-02 17:58:47 +0000
commitf27e5a09a0d815b8a4814152954ff87dadfdefc0 (patch)
treece7d964cbb5e39695b71481698f10cb099c23d4a /test/Sema/attr-weak.c
downloadFreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.zip
FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.tar.gz
Import Clang, at r72732.
Diffstat (limited to 'test/Sema/attr-weak.c')
-rw-r--r--test/Sema/attr-weak.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Sema/attr-weak.c b/test/Sema/attr-weak.c
new file mode 100644
index 0000000..b79e1e7
--- /dev/null
+++ b/test/Sema/attr-weak.c
@@ -0,0 +1,13 @@
+// RUN: clang-cc -verify -fsyntax-only %s
+
+extern int g0 __attribute__((weak));
+extern int g1 __attribute__((weak_import));
+int g2 __attribute__((weak));
+int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
+int __attribute__((weak_import)) g4(void);
+int __attribute__((weak_import)) g5(void) {
+}
+
+struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variable and function types}}
+struct __attribute__((weak_import)) s1 {}; // expected-warning {{'weak_import' attribute only applies to variable and function types}}
+
OpenPOWER on IntegriCloud