1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 %s -triple i386-pc-windows-msvc -fms-extensions -S -o - | FileCheck %s
4 // Yes, this is an assembly test from Clang, because we need to make it all the
5 // way through code generation to know if our call became a direct, pc-relative
6 // call or an indirect call through memory.
9 __declspec(dllimport
) int kimport(int);
11 int (*gptr(void))(int);
15 int (*r
)(int) = gptr();
17 // Simple case: direct call.
21 // Marginally harder: indirect calls, via dllimport or function pointer.
23 // CHECK: calll *({{.*}})
25 // CHECK: calll *({{.*}})
27 // Call through a global function pointer.
29 // CHECK: calll *_kptr
45 // CHECK-NEXT: loop _k
46 // CHECK-NEXT: loope _k
47 // CHECK-NEXT: loopne _k
53 // CHECK: movl _k, %eax
55 // CHECK: movl _kptr, %eax
58 // Test that this asm blob doesn't require more registers than available. This
59 // has to be an LLVM code generation test.
61 void __declspec(naked
) naked(void) {
66 // CHECK-LABEL: _naked:
68 // CHECK-NEXT: calll _k