1 ; RUN: llc -mtriple i386-pc-win32 < %s \
2 ; RUN: | FileCheck -check-prefix CHECK -check-prefix CHECK-CL %s
3 ; RUN: llc -mtriple i386-pc-mingw32 < %s \
4 ; RUN: | FileCheck -check-prefix CHECK -check-prefix CHECK-GCC %s
5 ; RUN: llc -mtriple i686-pc-cygwin %s -o - \
6 ; RUN: | FileCheck -check-prefix CHECK -check-prefix CHECK-GCC %s
7 ; RUN: llc -mtriple i386-pc-win32 < %s \
8 ; RUN: | FileCheck -check-prefix NOTEXPORTED %s
9 ; RUN: llc -mtriple i386-pc-mingw32 < %s \
10 ; RUN: | FileCheck -check-prefix NOTEXPORTED %s
11 ; RUN: llc -mtriple i686-pc-cygwin %s -o - \
12 ; RUN: | FileCheck -check-prefix NOTEXPORTED %s
16 define void @notExported() {
21 define dllexport void @f1() {
26 define dllexport void @f2() unnamed_addr {
30 declare dllexport void @notDefined()
32 ; CHECK: .globl _stdfun@0
33 define dllexport x86_stdcallcc void @stdfun() nounwind {
37 ; CHECK: .globl @fastfun@0
38 define dllexport x86_fastcallcc i32 @fastfun() nounwind {
42 ; CHECK: .globl _thisfun
43 define dllexport x86_thiscallcc void @thisfun() nounwind {
48 define linkonce_odr dllexport void @lnk1() {
53 define linkonce_odr dllexport void @lnk2() alwaysinline {
57 ; CHECK: .globl _weak1
58 define weak_odr dllexport void @weak1() {
65 @Var1 = dllexport global i32 1, align 4
69 @Var2 = dllexport unnamed_addr constant i32 1
72 @Var3 = common dllexport global i32 0, align 4
74 ; CHECK: .globl _WeakVar1
75 @WeakVar1 = weak_odr dllexport global i32 1, align 4
77 ; CHECK: .globl _WeakVar2
78 @WeakVar2 = weak_odr dllexport unnamed_addr constant i32 1
81 ; CHECK: .globl _alias
82 ; CHECK: .set _alias, _notExported
83 @alias = dllexport alias void(), void()* @notExported
85 ; CHECK: .globl _alias2
86 ; CHECK: .set _alias2, _f1
87 @alias2 = dllexport alias void(), void()* @f1
89 ; CHECK: .globl _alias3
90 ; CHECK: .set _alias3, _notExported
91 @alias3 = dllexport alias void(), void()* @notExported
93 ; CHECK: .weak _weak_alias
94 ; CHECK: .set _weak_alias, _f1
95 @weak_alias = weak_odr dllexport alias void(), void()* @f1
97 ; Verify items that should not be exported do not appear in the export table.
98 ; We use a separate check prefix to avoid confusion between -NOT and -SAME.
99 ; NOTEXPORTED: .section .drectve
100 ; NOTEXPORTED-NOT: notExported
101 ; NOTEXPORTED-NOT: notDefined
103 ; CHECK: .section .drectve
104 ; CHECK-CL: .ascii " /EXPORT:_f1"
105 ; CHECK-CL: .ascii " /EXPORT:_f2"
106 ; CHECK-CL: .ascii " /EXPORT:_stdfun@0"
107 ; CHECK-CL: .ascii " /EXPORT:@fastfun@0"
108 ; CHECK-CL: .ascii " /EXPORT:_thisfun"
109 ; CHECK-CL: .ascii " /EXPORT:_lnk1"
110 ; CHECK-CL: .ascii " /EXPORT:_lnk2"
111 ; CHECK-CL: .ascii " /EXPORT:_weak1"
112 ; CHECK-CL: .ascii " /EXPORT:_Var1,DATA"
113 ; CHECK-CL: .ascii " /EXPORT:_Var2,DATA"
114 ; CHECK-CL: .ascii " /EXPORT:_Var3,DATA"
115 ; CHECK-CL: .ascii " /EXPORT:_WeakVar1,DATA"
116 ; CHECK-CL: .ascii " /EXPORT:_WeakVar2,DATA"
117 ; CHECK-CL: .ascii " /EXPORT:_alias"
118 ; CHECK-CL: .ascii " /EXPORT:_alias2"
119 ; CHECK-CL: .ascii " /EXPORT:_alias3"
120 ; CHECK-CL: .ascii " /EXPORT:_weak_alias"
121 ; CHECK-GCC: .ascii " -export:f1"
122 ; CHECK-GCC: .ascii " -export:f2"
123 ; CHECK-GCC: .ascii " -export:stdfun@0"
124 ; CHECK-GCC: .ascii " -export:@fastfun@0"
125 ; CHECK-GCC: .ascii " -export:thisfun"
126 ; CHECK-GCC: .ascii " -export:lnk1"
127 ; CHECK-GCC: .ascii " -export:lnk2"
128 ; CHECK-GCC: .ascii " -export:weak1"
129 ; CHECK-GCC: .ascii " -export:Var1,data"
130 ; CHECK-GCC: .ascii " -export:Var2,data"
131 ; CHECK-GCC: .ascii " -export:Var3,data"
132 ; CHECK-GCC: .ascii " -export:WeakVar1,data"
133 ; CHECK-GCC: .ascii " -export:WeakVar2,data"
134 ; CHECK-GCC: .ascii " -export:alias"
135 ; CHECK-GCC: .ascii " -export:alias2"
136 ; CHECK-GCC: .ascii " -export:alias3"
137 ; CHECK-GCC: .ascii " -export:weak_alias"