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 {
50 define linkonce_odr dllexport void @lnk1() comdat {
57 define linkonce_odr dllexport void @lnk2() alwaysinline comdat {
62 define weak_odr dllexport void @weak1() {
69 @Var1 = dllexport global i32 1, align 4
73 @Var2 = dllexport unnamed_addr constant i32 1
76 @Var3 = common dllexport global i32 0, align 4
78 ; CHECK: .weak _WeakVar1
79 @WeakVar1 = weak_odr dllexport global i32 1, align 4
81 ; CHECK: .weak _WeakVar2
82 @WeakVar2 = weak_odr dllexport unnamed_addr constant i32 1
84 ; CHECK: .globl "_complex-name"
85 @"complex-name" = dllexport global i32 1, align 4
87 ; CHECK: .globl _complex.name
88 @"complex.name" = dllexport global i32 1, align 4
91 ; Verify items that should not be exported do not appear in the export table.
92 ; We use a separate check prefix to avoid confusion between -NOT and -SAME.
93 ; NOTEXPORTED: .section .drectve
94 ; NOTEXPORTED-NOT: :notExported
95 ; NOTEXPORTED-NOT: :notDefined
97 ; CHECK: .section .drectve
98 ; CHECK-CL: .ascii " /EXPORT:_f1"
99 ; CHECK-CL: .ascii " /EXPORT:_f2"
100 ; CHECK-CL: .ascii " /EXPORT:_stdfun@0"
101 ; CHECK-CL: .ascii " /EXPORT:@fastfun@0"
102 ; CHECK-CL: .ascii " /EXPORT:_thisfun"
103 ; CHECK-CL: .ascii " /EXPORT:_lnk1"
104 ; CHECK-CL: .ascii " /EXPORT:_lnk2"
105 ; CHECK-CL: .ascii " /EXPORT:_weak1"
106 ; CHECK-CL: .ascii " /EXPORT:_Var1,DATA"
107 ; CHECK-CL: .ascii " /EXPORT:_Var2,DATA"
108 ; CHECK-CL: .ascii " /EXPORT:_Var3,DATA"
109 ; CHECK-CL: .ascii " /EXPORT:_WeakVar1,DATA"
110 ; CHECK-CL: .ascii " /EXPORT:_WeakVar2,DATA"
111 ; CHECK-CL: .ascii " /EXPORT:\"_complex-name\",DATA"
112 ; CHECK-CL: .ascii " /EXPORT:\"_complex.name\",DATA"
113 ; CHECK-CL: .ascii " /EXPORT:_alias"
114 ; CHECK-CL: .ascii " /EXPORT:_alias2"
115 ; CHECK-CL: .ascii " /EXPORT:_alias3"
116 ; CHECK-CL: .ascii " /EXPORT:_weak_alias"
117 ; CHECK-GCC: .ascii " -export:f1"
118 ; CHECK-GCC: .ascii " -export:f2"
119 ; CHECK-GCC: .ascii " -export:stdfun@0"
120 ; CHECK-GCC: .ascii " -export:@fastfun@0"
121 ; CHECK-GCC: .ascii " -export:thisfun"
122 ; CHECK-GCC: .ascii " -export:lnk1"
123 ; CHECK-GCC: .ascii " -export:lnk2"
124 ; CHECK-GCC: .ascii " -export:weak1"
125 ; CHECK-GCC: .ascii " -export:Var1,data"
126 ; CHECK-GCC: .ascii " -export:Var2,data"
127 ; CHECK-GCC: .ascii " -export:Var3,data"
128 ; CHECK-GCC: .ascii " -export:WeakVar1,data"
129 ; CHECK-GCC: .ascii " -export:WeakVar2,data"
130 ; CHECK-GCC: .ascii " -export:\"complex-name\",data"
131 ; CHECK-GCC: .ascii " -export:\"complex.name\",data"
132 ; CHECK-GCC: .ascii " -export:alias"
133 ; CHECK-GCC: .ascii " -export:alias2"
134 ; CHECK-GCC: .ascii " -export:alias3"
135 ; CHECK-GCC: .ascii " -export:weak_alias"
137 ; CHECK: .globl _alias
138 ; CHECK: .set _alias, _notExported
139 @alias = dllexport alias void(), ptr @notExported
141 ; CHECK: .globl _alias2
142 ; CHECK: .set _alias2, _f1
143 @alias2 = dllexport alias void(), ptr @f1
145 ; CHECK: .globl _alias3
146 ; CHECK: .set _alias3, _notExported
147 @alias3 = dllexport alias void(), ptr @notExported
149 ; CHECK: .weak _weak_alias
150 ; CHECK: .set _weak_alias, _f1
151 @weak_alias = weak_odr dllexport alias void(), ptr @f1