1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++11 -emit-llvm -o - %s | FileCheck %s
3 __attribute__((internal_linkage
)) void f() {}
4 // CHECK-DAG: define internal void @_ZL1fv
8 static int y
__attribute__((internal_linkage
));
9 static int y2
[[clang::internal_linkage
]];
10 // CHECK-DAG: @_ZN1A1yE = internal global
11 // CHECK-DAG: @_ZN1A2y2E = internal global
12 void f1() __attribute__((internal_linkage
));
13 // CHECK-DAG: define internal void @_ZN1A2f1Ev
14 void f2() __attribute__((internal_linkage
)) {}
15 // CHECK-DAG: define internal void @_ZN1A2f2Ev
16 static void f4() __attribute__((internal_linkage
)) {}
17 // CHECK-DAG: define internal void @_ZN1A2f4Ev
18 A() __attribute__((internal_linkage
)) {}
19 // CHECK-DAG: define internal void @_ZN1AC1Ev
20 // CHECK-DAG: define internal void @_ZN1AC2Ev
21 ~A() __attribute__((internal_linkage
)) {}
22 // CHECK-DAG: define internal void @_ZN1AD1Ev
23 // CHECK-DAG: define internal void @_ZN1AD2Ev
32 // Forward declaration w/o an attribute.
35 // Internal_linkage on a class affects all its members.
36 class __attribute__((internal_linkage
)) B
{
39 // CHECK-DAG: define internal void @_ZNL1BC1Ev
40 // CHECK-DAG: define internal void @_ZNL1BC2Ev
42 // CHECK-DAG: define internal void @_ZNL1BD1Ev
43 // CHECK-DAG: define internal void @_ZNL1BD2Ev
45 // CHECK-DAG: define internal void @_ZNL1B1fEv
47 // CHECK-DAG: @_ZNL1B1xE = internal global
52 // Forward declaration with the attribute.
53 class __attribute__((internal_linkage
)) C
;
57 // CHECK-DAG: @_ZNL1C1xE = internal global
62 __attribute__((internal_linkage
)) void g();
64 // CHECK-DAG: define internal void @_ZL1gv()