• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
8; CHECK: .text
9
10define void @notExported() {
11	ret void
12}
13
14; CHECK: .globl _f1
15define dllexport void @f1() {
16	ret void
17}
18
19; CHECK: .globl _f2
20define dllexport void @f2() unnamed_addr {
21	ret void
22}
23
24; CHECK: .globl _stdfun@0
25define dllexport x86_stdcallcc void @stdfun() nounwind {
26	ret void
27}
28
29; CHECK: .globl @fastfun@0
30define dllexport x86_fastcallcc i32 @fastfun() nounwind {
31	ret i32 0
32}
33
34; CHECK: .globl _thisfun
35define dllexport x86_thiscallcc void @thisfun() nounwind {
36	ret void
37}
38
39; CHECK: .section .text,"xr",discard,_lnk1
40; CHECK: .globl _lnk1
41define linkonce_odr dllexport void @lnk1() {
42	ret void
43}
44
45; CHECK: .section .text,"xr",discard,_lnk2
46; CHECK: .globl _lnk2
47define linkonce_odr dllexport void @lnk2() alwaysinline {
48	ret void
49}
50
51; CHECK: .section .text,"xr",discard,_weak1
52; CHECK: .globl _weak1
53define weak_odr dllexport void @weak1() {
54	ret void
55}
56
57
58; CHECK: .data
59; CHECK: .globl _Var1
60@Var1 = dllexport global i32 1, align 4
61
62; CHECK: .rdata,"rd"
63; CHECK: .globl _Var2
64@Var2 = dllexport unnamed_addr constant i32 1
65
66; CHECK: .comm _Var3
67@Var3 = common dllexport global i32 0, align 4
68
69; CHECK: .section .data,"wd",discard,_WeakVar1
70; CHECK: .globl _WeakVar1
71@WeakVar1 = weak_odr dllexport global i32 1, align 4
72
73; CHECK: .section .rdata,"rd",discard,_WeakVar2
74; CHECK: .globl _WeakVar2
75@WeakVar2 = weak_odr dllexport unnamed_addr constant i32 1
76
77
78; CHECK: .globl _alias
79; CHECK: _alias = _notExported
80@alias = dllexport alias void()* @notExported
81
82; CHECK: .globl _alias2
83; CHECK: _alias2 = _f1
84@alias2 = dllexport alias void()* @f1
85
86; CHECK: .globl _alias3
87; CHECK: _alias3 = _notExported
88@alias3 = dllexport alias void()* @notExported
89
90; CHECK: .weak _weak_alias
91; CHECK: _weak_alias = _f1
92@weak_alias = dllexport alias weak_odr void()* @f1
93
94
95; CHECK: .section .drectve
96; CHECK-CL: " /EXPORT:_Var1,DATA"
97; CHECK-CL: " /EXPORT:_Var2,DATA"
98; CHECK-CL: " /EXPORT:_Var3,DATA"
99; CHECK-CL: " /EXPORT:_WeakVar1,DATA"
100; CHECK-CL: " /EXPORT:_WeakVar2,DATA"
101; CHECK-CL: " /EXPORT:_f1"
102; CHECK-CL: " /EXPORT:_f2"
103; CHECK-CL: " /EXPORT:_stdfun@0"
104; CHECK-CL: " /EXPORT:@fastfun@0"
105; CHECK-CL: " /EXPORT:_thisfun"
106; CHECK-CL: " /EXPORT:_lnk1"
107; CHECK-CL: " /EXPORT:_lnk2"
108; CHECK-CL: " /EXPORT:_weak1"
109; CHECK-CL: " /EXPORT:_alias"
110; CHECK-CL: " /EXPORT:_alias2"
111; CHECK-CL: " /EXPORT:_alias3"
112; CHECK-CL: " /EXPORT:_weak_alias"
113; CHECK-GCC: " -export:Var1,data"
114; CHECK-GCC: " -export:Var2,data"
115; CHECK-GCC: " -export:Var3,data"
116; CHECK-GCC: " -export:WeakVar1,data"
117; CHECK-GCC: " -export:WeakVar2,data"
118; CHECK-GCC: " -export:f1"
119; CHECK-GCC: " -export:f2"
120; CHECK-GCC: " -export:stdfun@0"
121; CHECK-GCC: " -export:@fastfun@0"
122; CHECK-GCC: " -export:thisfun"
123; CHECK-GCC: " -export:lnk1"
124; CHECK-GCC: " -export:lnk2"
125; CHECK-GCC: " -export:weak1"
126; CHECK-GCC: " -export:alias"
127; CHECK-GCC: " -export:alias2"
128; CHECK-GCC: " -export:alias3"
129; CHECK-GCC: " -export:weak_alias"
130
131