1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
3 // RUN: -DPARENT_CLASS_VISIBILITY="" -DCHILD_CLASS_VISIBILITY="" \
4 // RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
5 // RUN: FileCheck -check-prefix=CHECK-X %s
6 // RUN: %clang -target x86_64-unknown-linux-gnu -o - -c \
7 // RUN: -DPARENT_CLASS_VISIBILITY="" -DCHILD_CLASS_VISIBILITY="" \
8 // RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
9 // RUN: llvm-readelf -s - 2>&1 | \
10 // RUN: FileCheck -check-prefix=CHECK-X-RE %s
12 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
13 // RUN: -DPARENT_CLASS_VISIBILITY=HIDDEN -DCHILD_CLASS_VISIBILITY="" \
14 // RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
15 // RUN: FileCheck -check-prefix=CHECK-HP %s
16 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
17 // RUN: -interface-stub-version=ifs-v1 \
18 // RUN: -DPARENT_CLASS_VISIBILITY=HIDDEN -DCHILD_CLASS_VISIBILITY="" \
19 // RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
20 // RUN: FileCheck -check-prefix=CHECK-HP2 %s
21 // RUN: %clang -target x86_64-unknown-linux-gnu -o - -c \
22 // RUN: -DPARENT_CLASS_VISIBILITY=HIDDEN -DCHILD_CLASS_VISIBILITY="" \
23 // RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
24 // RUN: llvm-readelf -s - 2>&1 | \
25 // RUN: FileCheck -check-prefix=CHECK-HP-RE %s
27 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
28 // RUN: -DPARENT_CLASS_VISIBILITY="" -DCHILD_CLASS_VISIBILITY=HIDDEN \
29 // RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
30 // RUN: FileCheck -check-prefix=CHECK-HC %s
31 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
32 // RUN: -DPARENT_CLASS_VISIBILITY="" -DCHILD_CLASS_VISIBILITY=HIDDEN \
33 // RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
34 // RUN: FileCheck -check-prefix=CHECK-HC2 %s
35 // RUN: %clang -target x86_64-unknown-linux-gnu -o - -c \
36 // RUN: -DPARENT_CLASS_VISIBILITY="" -DCHILD_CLASS_VISIBILITY=HIDDEN \
37 // RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
38 // RUN: llvm-readelf -s - 2>&1 | \
39 // RUN: FileCheck -check-prefix=CHECK-HC-RE %s
41 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
42 // RUN: -DPARENT_CLASS_VISIBILITY=HIDDEN -DCHILD_CLASS_VISIBILITY=HIDDEN \
43 // RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
44 // RUN: FileCheck -check-prefix=CHECK-HP-HC %s
45 // RUN: %clang -target x86_64-unknown-linux-gnu -o - -c \
46 // RUN: -DPARENT_CLASS_VISIBILITY=HIDDEN -DCHILD_CLASS_VISIBILITY=HIDDEN \
47 // RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
48 // RUN: llvm-readelf -s - 2>&1 | \
49 // RUN: FileCheck -check-prefix=CHECK-HP-HC-RE %s
51 // CHECK-X-DAG: _ZN1CC2Ev
52 // CHECK-X-DAG: _ZN1CD0Ev
53 // CHECK-X-DAG: _ZN1CD2Ev
54 // CHECK-X-DAG: _ZN1SC2Ev
55 // CHECK-X-DAG: _ZN1SD0Ev
56 // CHECK-X-DAG: _ZN1SD2Ev
57 // CHECK-X-DAG: _ZN1C1mEv
58 // CHECK-X-DAG: _ZN1S1nEv
60 // CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1C1mEv
61 // CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CC2Ev
62 // CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CD0Ev
63 // CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CD2Ev
64 // CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1S1nEv
65 // CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SC2Ev
66 // CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SD0Ev
67 // CHECK-X-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SD2Ev
69 // CHECK-HP2-DAG: _ZN1CC2Ev
70 // CHECK-HP2-DAG: _ZN1CD0Ev
71 // CHECK-HP2-DAG: _ZN1CD2Ev
72 // CHECK-HP2-DAG: _ZN1C1mEv
74 // CHECK-HP-NOT: _ZN1S1nEv
75 // CHECK-HP-NOT: _ZN1SC2Ev
76 // CHECK-HP-NOT: _ZN1SD0Ev
77 // CHECK-HP-NOT: _ZN1SD2Ev
79 // CHECK-HP-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1C1mEv
80 // CHECK-HP-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CC2Ev
81 // CHECK-HP-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CD0Ev
82 // CHECK-HP-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1CD2Ev
83 // CHECK-HP-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1S1nEv
84 // CHECK-HP-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SC2Ev
85 // CHECK-HP-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SD0Ev
86 // CHECK-HP-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SD2Ev
88 // CHECK-HC2-DAG: _ZN1SC2Ev
89 // CHECK-HC2-DAG: _ZN1SD0Ev
90 // CHECK-HC2-DAG: _ZN1SD2Ev
91 // CHECK-HC2-DAG: _ZN1S1nEv
93 // CHECK-HC-NOT: _ZN1C1mEv
94 // CHECK-HC-NOT: _ZN1CC2Ev
95 // CHECK-HC-NOT: _ZN1CD0Ev
96 // CHECK-HC-NOT: _ZN1CD2Ev
98 // CHECK-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1C1mEv
99 // CHECK-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CC2Ev
100 // CHECK-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CD0Ev
101 // CHECK-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CD2Ev
102 // CHECK-HC-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1S1nEv
103 // CHECK-HC-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SC2Ev
104 // CHECK-HC-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SD0Ev
105 // CHECK-HC-RE-DAG: FUNC WEAK DEFAULT [[#]] _ZN1SD2Ev
107 // CHECK-HP-HC-NOT: _ZN1CC2Ev
108 // CHECK-HP-HC-NOT: _ZN1CD0Ev
109 // CHECK-HP-HC-NOT: _ZN1CD2Ev
110 // CHECK-HP-HC-NOT: _ZN1SC2Ev
111 // CHECK-HP-HC-NOT: _ZN1SD0Ev
112 // CHECK-HP-HC-NOT: _ZN1SD2Ev
113 // CHECK-HP-HC-NOT: _ZN1C1mEv
114 // CHECK-HP-HC-NOT: _ZN1S1nEv
116 // CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1C1mEv
117 // CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CC2Ev
118 // CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CD0Ev
119 // CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1CD2Ev
120 // CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1S1nEv
121 // CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SC2Ev
122 // CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SD0Ev
123 // CHECK-HP-HC-RE-DAG: FUNC WEAK HIDDEN [[#]] _ZN1SD2Ev
125 // TODO: clang+llvm does not materialize complete ctors and dtors for the
126 // Itanium abi. Figure out why and add the check-not for these:
132 #define HIDDEN __attribute__((__visibility__("hidden")))
133 #define DEFAULT __attribute__((__visibility__("default")))
135 struct PARENT_CLASS_VISIBILITY S
{
137 virtual PARENT_METHOD_VISIBILITY
void n() {}
140 class CHILD_CLASS_VISIBILITY C
: public S
{
142 virtual CHILD_METHOD_VISIBILITY
void m() {}