File: internal_linkage.c

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (21 lines) | stat: -rw-r--r-- 1,457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: %clang_cc1 -fsyntax-only -verify %s

int var __attribute__((internal_linkage));
int var2 __attribute__((internal_linkage,common)); // expected-error{{'internal_linkage' and 'common' attributes are not compatible}} \
                                                   // expected-note{{conflicting attribute is here}}
int var3 __attribute__((common,internal_linkage)); // expected-error{{'common' and 'internal_linkage' attributes are not compatible}} \
                                                   // expected-note{{conflicting attribute is here}}

int var4 __attribute__((common)); // expected-error{{'common' and 'internal_linkage' attributes are not compatible}} \
// expected-note{{previous definition is here}}
int var4 __attribute__((internal_linkage)); // expected-note{{conflicting attribute is here}} \
// expected-error{{'internal_linkage' attribute does not appear on the first declaration of 'var4'}}

int var5 __attribute__((internal_linkage)); // expected-error{{'internal_linkage' and 'common' attributes are not compatible}}
int var5 __attribute__((common)); // expected-note{{conflicting attribute is here}}

__attribute__((internal_linkage)) int f() {}
struct __attribute__((internal_linkage)) S { // expected-warning{{'internal_linkage' attribute only applies to variables, functions, and classes}}
};

__attribute__((internal_linkage("foo"))) int g() {} // expected-error{{'internal_linkage' attribute takes no arguments}}