[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / 2009-03-09-WeakDeclarations-1.c
blobc0035a49b8389e843863b83a5f2d9c2773cca317
1 // RUN: %clang_cc1 -verify %s -triple i686-apple-darwin
2 // Insist upon warnings for inappropriate weak attributes.
4 // O.K.
5 extern int ext_weak_import __attribute__ ((__weak_import__));
7 // These are inappropriate, and should generate warnings:
8 int decl_weak_import __attribute__ ((__weak_import__)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
9 int decl_initialized_weak_import __attribute__ ((__weak_import__)) = 13; // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
11 // O.K.
12 extern int ext_f(void) __attribute__ ((__weak_import__));
14 // These are inappropriate, and should generate warnings:
15 int def_f(void) __attribute__ ((__weak_import__));
16 int __attribute__ ((__weak_import__)) decl_f(void) {return 0;};