1 ; RUN: llc -mtriple i386-pc-win32 < %s | FileCheck %s 2 ; RUN: llc -mtriple i386-pc-mingw32 < %s | FileCheck %s 3 ; 4 ; RUN: llc -mtriple i386-pc-mingw32 -O0 < %s | FileCheck %s -check-prefix=FAST 5 ; PR6275 6 ; 7 ; RUN: opt -mtriple i386-pc-win32 -O3 -S < %s | FileCheck %s -check-prefix=OPT 8 9 @Var1 = external dllimport global i32 10 @Var2 = available_externally dllimport unnamed_addr constant i32 1 11 12 declare dllimport void @fun() 13 14 define available_externally dllimport void @inline1() { 15 ret void 16 } 17 18 define available_externally dllimport void @inline2() alwaysinline { 19 ret void 20 } 21 22 declare dllimport x86_stdcallcc void @stdfun() nounwind 23 declare dllimport x86_fastcallcc void @fastfun() nounwind 24 declare dllimport x86_thiscallcc void @thisfun() nounwind 25 26 declare void @dummy(...) 27 28 define void @use() nounwind { 29 ; CHECK: calll *__imp__fun 30 ; FAST: movl __imp__fun, [[R:%[a-z]{3}]] 31 ; FAST-NEXT: calll *[[R]] 32 call void @fun() 33 34 ; CHECK: calll *__imp__inline1 35 ; CHECK: calll *__imp__inline2 36 call void @inline1() 37 call void @inline2() 38 39 ; CHECK: calll *__imp__stdfun@0 40 ; CHECK: calll *__imp_@fastfun@0 41 ; CHECK: calll *__imp__thisfun 42 call void @stdfun() 43 call void @fastfun() 44 call void @thisfun() 45 46 ; available_externally uses go away 47 ; OPT-NOT: call void @inline1() 48 ; OPT-NOT: call void @inline2() 49 ; OPT-NOT: load i32, i32* @Var2 50 ; OPT: call void (...) @dummy(i32 %1, i32 1) 51 52 ; CHECK-DAG: movl __imp__Var1, [[R1:%[a-z]{3}]] 53 ; CHECK-DAG: movl __imp__Var2, [[R2:%[a-z]{3}]] 54 %1 = load i32, i32* @Var1 55 %2 = load i32, i32* @Var2 56 call void(...) @dummy(i32 %1, i32 %2) 57 58 ret void 59 } 60 61 ; CHECK: _fp: 62 ; CHECK-NEXT: .long _fun 63 @fp = constant void ()* @fun 64