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 {
25 define linkonce_odr dllexport void @lnk1() comdat {
32 define linkonce_odr dllexport void @lnk2() alwaysinline comdat {
37 define weak_odr dllexport void @weak1() {
44 @Var1 = dllexport global i32 1, align 4
48 @Var2 = dllexport unnamed_addr constant i32 1
51 @Var3 = common dllexport global i32 0, align 4
53 ; CHECK: .weak WeakVar1
54 @WeakVar1 = weak_odr dllexport global i32 1, align 4
56 ; CHECK: .weak WeakVar2
57 @WeakVar2 = weak_odr dllexport unnamed_addr constant i32 1
60 ; CHECK: .weak WeakVar3
61 @WeakVar3 = weak_odr dllexport global i32 0, align 4
64 ; Verify items that should not be exported do not appear in the export table.
65 ; We use a separate check prefix to avoid confusion between -NOT and -SAME.
66 ; NOTEXPORTED: .section .drectve
67 ; NOTEXPORTED-NOT: :notExported
68 ; NOTEXPORTED-NOT: :aliasNotExported
69 ; NOTEXPORTED-NOT: :exportedButNotDefinedVariable
70 ; NOTEXPORTED-NOT: :exportedButNotDefinedFunction
72 ; CHECK: .section .drectve
73 ; WIN32: .ascii " /EXPORT:f1"
74 ; WIN32: .ascii " /EXPORT:f2"
75 ; WIN32: .ascii " /EXPORT:lnk1"
76 ; WIN32: .ascii " /EXPORT:lnk2"
77 ; WIN32: .ascii " /EXPORT:weak1"
78 ; WIN32: .ascii " /EXPORT:Var1,DATA"
79 ; WIN32: .ascii " /EXPORT:Var2,DATA"
80 ; WIN32: .ascii " /EXPORT:Var3,DATA"
81 ; WIN32: .ascii " /EXPORT:WeakVar1,DATA"
82 ; WIN32: .ascii " /EXPORT:WeakVar2,DATA"
83 ; WIN32: .ascii " /EXPORT:WeakVar3,DATA"
84 ; WIN32: .ascii " /EXPORT:alias"
85 ; WIN32: .ascii " /EXPORT:alias2"
86 ; WIN32: .ascii " /EXPORT:alias3"
87 ; WIN32: .ascii " /EXPORT:weak_alias"
88 ; WIN32: .ascii " /EXPORT:blob_alias"
89 ; MINGW: .ascii " -export:f1"
90 ; MINGW: .ascii " -export:f2"
91 ; MINGW: .ascii " -export:lnk1"
92 ; MINGW: .ascii " -export:lnk2"
93 ; MINGW: .ascii " -export:weak1"
94 ; MINGW: .ascii " -export:Var1,data"
95 ; MINGW: .ascii " -export:Var2,data"
96 ; MINGW: .ascii " -export:Var3,data"
97 ; MINGW: .ascii " -export:WeakVar1,data"
98 ; MINGW: .ascii " -export:WeakVar2,data"
99 ; MINGW: .ascii " -export:WeakVar3,data"
100 ; MINGW: .ascii " -export:alias"
101 ; MINGW: .ascii " -export:alias2"
102 ; MINGW: .ascii " -export:alias3"
103 ; MINGW: .ascii " -export:weak_alias"
104 ; MINGW: .ascii " -export:blob_alias"
106 ; CHECK: .globl alias
107 ; CHECK: .set alias, notExported
108 @alias = dllexport alias void(), ptr @notExported
110 ; CHECK: .globl aliasNotExported
111 ; CHECK: .set aliasNotExported, f1
112 @aliasNotExported = alias void(), ptr @f1
114 ; CHECK: .globl alias2
115 ; CHECK: .set alias2, f1
116 @alias2 = dllexport alias void(), ptr @f1
118 ; CHECK: .globl alias3
119 ; CHECK: .set alias3, notExported
120 @alias3 = dllexport alias void(), ptr @notExported
122 ; CHECK: .weak weak_alias
123 ; CHECK: .set weak_alias, f1
124 @weak_alias = weak_odr dllexport alias void(), ptr @f1
126 @blob = global [6 x i8] c"\B8*\00\00\00\C3", section ".text", align 16
127 @blob_alias = dllexport alias i32 (), ptr @blob
129 @exportedButNotDefinedVariable = external dllexport global i32
130 declare dllexport void @exportedButNotDefinedFunction()
133 store i32 4, ptr @exportedButNotDefinedVariable, align 4
134 call void @exportedButNotDefinedFunction()