visibility-inlines-hidden-static-local-var.cpp
1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fvisibility-inlines-hidden -fvisibility-inlines-hidden-static-local-var %s -emit-llvm -o - | FileCheck %s
#define used __attribute__((used))
used inline void f1() {
// CHECK: @_ZZ2f1vE6f1_var = linkonce_odr hidden global i32 0
static int f1_var = 0;
}
__attribute__((visibility("default")))
used inline void f2() {
// CHECK: @_ZZ2f2vE6f2_var = linkonce_odr global i32 0
static int f2_var = 0;
}
struct S {
used void f3() {
// CHECK: @_ZZN1S2f3EvE6f3_var = linkonce_odr hidden global i32 0
static int f3_var = 0;
}
void f6();
void f7();
};
used void f4() {
// CHECK: @_ZZ2f4vE6f4_var = internal global i32 0
static int f4_var = 0;
}
__attribute__((visibility("default")))
used void f5() {
// CHECK: @_ZZ2f5vE6f5_var = internal global i32 0
static int f5_var = 0;
}
used void S::f6() {
// CHECK: @_ZZN1S2f6EvE6f6_var = internal global i32 0
static int f6_var = 0;
}
used inline void S::f7() {
// CHECK: @_ZZN1S2f7EvE6f7_var = linkonce_odr hidden global i32 0
static int f7_var = 0;
}
struct __attribute__((visibility("default"))) S2 {
used void f8() {
// CHECK: @_ZZN2S22f8EvE6f8_var = linkonce_odr hidden global i32 0
static int f8_var = 0;
}
};