1 ; RUN: llc -mtriple x86_64-pc-win32 < %s | FileCheck %s
2 ; RUN: llc -mtriple x86_64-pc-mingw32 < %s | FileCheck %s
4 ; RUN: llc -mtriple x86_64-pc-mingw32 -O0 < %s | FileCheck %s
5 ; RUN: llc -mtriple x86_64-pc-windows-msvc -O0 < %s | FileCheck %s
8 ; RUN: opt -mtriple x86_64-pc-win32 -O3 -S < %s | FileCheck %s -check-prefix=OPT
10 @Var1 = external dllimport global i32
11 @Var2 = available_externally dllimport unnamed_addr constant i32 1
13 declare dllimport void @fun()
15 define available_externally dllimport void @inline1() {
19 define available_externally dllimport void @inline2() {
23 declare void @dummy(...)
25 define void @use() nounwind {
26 ; CHECK: callq *__imp_fun(%rip)
29 ; CHECK: callq *__imp_inline1(%rip)
30 ; CHECK: callq *__imp_inline2(%rip)
34 ; available_externally uses go away
35 ; OPT-NOT: call void @inline1()
36 ; OPT-NOT: call void @inline2()
37 ; OPT-NOT: load i32, ptr @Var2
38 ; OPT: call void (...) @dummy(i32 %1, i32 1)
40 ; CHECK-DAG: movq __imp_Var1(%rip), [[R1:%[a-z]{3}]]
41 ; CHECK-DAG: movq __imp_Var2(%rip), [[R2:%[a-z]{3}]]
42 %1 = load i32, ptr @Var1
43 %2 = load i32, ptr @Var2
44 call void(...) @dummy(i32 %1, i32 %2)