annotate clang/test/Sema/2009-03-09-WeakDeclarations-1.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -verify %s -triple i686-apple-darwin
anatofuz
parents:
diff changeset
2 // Insist upon warnings for inappropriate weak attributes.
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 // O.K.
anatofuz
parents:
diff changeset
5 extern int ext_weak_import __attribute__ ((__weak_import__));
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 // These are inappropriate, and should generate warnings:
anatofuz
parents:
diff changeset
8 int decl_weak_import __attribute__ ((__weak_import__)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
anatofuz
parents:
diff changeset
9 int decl_initialized_weak_import __attribute__ ((__weak_import__)) = 13; // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 // O.K.
anatofuz
parents:
diff changeset
12 extern int ext_f(void) __attribute__ ((__weak_import__));
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 // These are inappropriate, and should generate warnings:
anatofuz
parents:
diff changeset
15 int def_f(void) __attribute__ ((__weak_import__));
anatofuz
parents:
diff changeset
16 int __attribute__ ((__weak_import__)) decl_f(void) {return 0;};