1 ; RUN: llc -mtriple x86_64-pc-win32 < %s | FileCheck -check-prefix=CHECK -check-prefix=WIN32 %s
2 ; RUN: llc -mtriple x86_64-pc-mingw32 < %s | FileCheck -check-prefix=CHECK -check-prefix=MINGW %s
3 ; RUN: llc -mtriple x86_64-pc-win32 < %s | FileCheck -check-prefix=NOTEXPORTED %s
4 ; RUN: llc -mtriple x86_64-pc-mingw32 < %s | FileCheck -check-prefix=NOTEXPORTED %s
8 define void @notExported() {
13 define dllexport void @f1() {
18 define dllexport void @f2() unnamed_addr {
23 define linkonce_odr dllexport void @lnk1() {
28 define linkonce_odr dllexport void @lnk2() alwaysinline {
33 define weak_odr dllexport void @weak1() {
40 @Var1 = dllexport global i32 1, align 4
44 @Var2 = dllexport unnamed_addr constant i32 1
47 @Var3 = common dllexport global i32 0, align 4
49 ; CHECK: .globl WeakVar1
50 @WeakVar1 = weak_odr dllexport global i32 1, align 4
52 ; CHECK: .globl WeakVar2
53 @WeakVar2 = weak_odr dllexport unnamed_addr constant i32 1
56 ; CHECK: .globl WeakVar3
57 @WeakVar3 = weak_odr dllexport global i32 0, align 4
61 ; CHECK: .set alias, notExported
62 @alias = dllexport alias void(), void()* @notExported
64 ; CHECK: .globl aliasNotExported
65 ; CHECK: .set aliasNotExported, f1
66 @aliasNotExported = alias void(), void()* @f1
68 ; CHECK: .globl alias2
69 ; CHECK: .set alias2, f1
70 @alias2 = dllexport alias void(), void()* @f1
72 ; CHECK: .globl alias3
73 ; CHECK: .set alias3, notExported
74 @alias3 = dllexport alias void(), void()* @notExported
76 ; CHECK: .weak weak_alias
77 ; CHECK: .set weak_alias, f1
78 @weak_alias = weak_odr dllexport alias void(), void()* @f1
80 @blob = global [6 x i8] c"\B8*\00\00\00\C3", section ".text", align 16
81 @blob_alias = dllexport alias i32 (), bitcast ([6 x i8]* @blob to i32 ()*)
83 @exportedButNotDefinedVariable = external dllexport global i32
84 declare dllexport void @exportedButNotDefinedFunction()
87 store i32 4, i32* @exportedButNotDefinedVariable, align 4
88 call void @exportedButNotDefinedFunction()
92 ; Verify items that should not be exported do not appear in the export table.
93 ; We use a separate check prefix to avoid confusion between -NOT and -SAME.
94 ; NOTEXPORTED: .section .drectve
95 ; NOTEXPORTED-NOT: notExported
96 ; NOTEXPORTED-NOT: aliasNotExported
97 ; NOTEXPORTED-NOT: exportedButNotDefinedVariable
98 ; NOTEXPORTED-NOT: exportedButNotDefinedFunction
100 ; CHECK: .section .drectve
101 ; WIN32: .ascii " /EXPORT:f1"
102 ; WIN32: .ascii " /EXPORT:f2"
103 ; WIN32: .ascii " /EXPORT:lnk1"
104 ; WIN32: .ascii " /EXPORT:lnk2"
105 ; WIN32: .ascii " /EXPORT:weak1"
106 ; WIN32: .ascii " /EXPORT:Var1,DATA"
107 ; WIN32: .ascii " /EXPORT:Var2,DATA"
108 ; WIN32: .ascii " /EXPORT:Var3,DATA"
109 ; WIN32: .ascii " /EXPORT:WeakVar1,DATA"
110 ; WIN32: .ascii " /EXPORT:WeakVar2,DATA"
111 ; WIN32: .ascii " /EXPORT:WeakVar3,DATA"
112 ; WIN32: .ascii " /EXPORT:alias"
113 ; WIN32: .ascii " /EXPORT:alias2"
114 ; WIN32: .ascii " /EXPORT:alias3"
115 ; WIN32: .ascii " /EXPORT:weak_alias"
116 ; WIN32: .ascii " /EXPORT:blob_alias"
117 ; MINGW: .ascii " -export:f1"
118 ; MINGW: .ascii " -export:f2"
119 ; MINGW: .ascii " -export:lnk1"
120 ; MINGW: .ascii " -export:lnk2"
121 ; MINGW: .ascii " -export:weak1"
122 ; MINGW: .ascii " -export:Var1,data"
123 ; MINGW: .ascii " -export:Var2,data"
124 ; MINGW: .ascii " -export:Var3,data"
125 ; MINGW: .ascii " -export:WeakVar1,data"
126 ; MINGW: .ascii " -export:WeakVar2,data"
127 ; MINGW: .ascii " -export:WeakVar3,data"
128 ; MINGW: .ascii " -export:alias"
129 ; MINGW: .ascii " -export:alias2"
130 ; MINGW: .ascii " -export:alias3"
131 ; MINGW: .ascii " -export:weak_alias"
132 ; MINGW: .ascii " -export:blob_alias"