1 ; RUN: llc -mtriple i386-pc-win32 < %s | FileCheck %s
2 ; RUN: llc -mtriple i386-pc-mingw32 < %s | FileCheck %s
4 ; RUN: llc -mtriple i386-pc-mingw32 -O0 < %s | FileCheck %s
5 ; RUN: llc -mtriple i386-pc-windows-msvc -O0 < %s | FileCheck %s
8 ; RUN: opt -mtriple i386-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() alwaysinline {
23 declare dllimport x86_stdcallcc void @stdfun() nounwind
24 declare dllimport x86_fastcallcc void @fastfun() nounwind
25 declare dllimport x86_thiscallcc void @thisfun() nounwind
27 declare void @dummy(...)
29 define void @use() nounwind {
30 ; CHECK: calll *__imp__fun
33 ; CHECK: calll *__imp__inline1
34 ; CHECK: calll *__imp__inline2
38 ; CHECK: calll *__imp__stdfun@0
39 ; CHECK: calll *__imp_@fastfun@0
40 ; CHECK: calll *__imp__thisfun
45 ; available_externally uses go away
46 ; OPT-NOT: call void @inline1()
47 ; OPT-NOT: call void @inline2()
48 ; OPT-NOT: load i32, i32* @Var2
49 ; OPT: call void (...) @dummy(i32 %1, i32 1)
51 ; CHECK-DAG: movl __imp__Var1, [[R1:%[a-z]{3}]]
52 ; CHECK-DAG: movl __imp__Var2, [[R2:%[a-z]{3}]]
53 %1 = load i32, i32* @Var1
54 %2 = load i32, i32* @Var2
55 call void(...) @dummy(i32 %1, i32 %2)
61 ; CHECK-NEXT: .long _fun
62 @fp = constant void ()* @fun