1 ; RUN: llc < %s -mtriple=x86_64-w64-mingw32 | FileCheck %s -check-prefix=CHECK-X64
2 ; RUN: llc < %s -mtriple=i686-w64-mingw32 | FileCheck %s -check-prefix=CHECK-X86
4 @var = external local_unnamed_addr global i32, align 4
5 @dsolocalvar = external dso_local local_unnamed_addr global i32, align 4
6 @localvar = dso_local local_unnamed_addr global i32 0, align 4
7 @localcommon = common dso_local local_unnamed_addr global i32 0, align 4
8 @extvar = external dllimport local_unnamed_addr global i32, align 4
10 define dso_local i32 @getVar() {
11 ; CHECK-X64-LABEL: getVar:
12 ; CHECK-X64: movq .refptr.var(%rip), %rax
13 ; CHECK-X64: movl (%rax), %eax
15 ; CHECK-X86-LABEL: _getVar:
16 ; CHECK-X86: movl .refptr._var, %eax
17 ; CHECK-X86: movl (%eax), %eax
20 %0 = load i32, i32* @var, align 4
24 define dso_local i32 @getDsoLocalVar() {
25 ; CHECK-X64-LABEL: getDsoLocalVar:
26 ; CHECK-X64: movl dsolocalvar(%rip), %eax
28 ; CHECK-X86-LABEL: _getDsoLocalVar:
29 ; CHECK-X86: movl _dsolocalvar, %eax
32 %0 = load i32, i32* @dsolocalvar, align 4
36 define dso_local i32 @getLocalVar() {
37 ; CHECK-X64-LABEL: getLocalVar:
38 ; CHECK-X64: movl localvar(%rip), %eax
40 ; CHECK-X86-LABEL: _getLocalVar:
41 ; CHECK-X86: movl _localvar, %eax
44 %0 = load i32, i32* @localvar, align 4
48 define dso_local i32 @getLocalCommon() {
49 ; CHECK-X64-LABEL: getLocalCommon:
50 ; CHECK-X64: movl localcommon(%rip), %eax
52 ; CHECK-X86-LABEL: _getLocalCommon:
53 ; CHECK-X86: movl _localcommon, %eax
56 %0 = load i32, i32* @localcommon, align 4
60 define dso_local i32 @getExtVar() {
61 ; CHECK-X64-LABEL: getExtVar:
62 ; CHECK-X64: movq __imp_extvar(%rip), %rax
63 ; CHECK-X64: movl (%rax), %eax
65 ; CHECK-X86-LABEL: _getExtVar:
66 ; CHECK-X86: movl __imp__extvar, %eax
67 ; CHECK-X86: movl (%eax), %eax
70 %0 = load i32, i32* @extvar, align 4
74 define dso_local void @callFunc() {
75 ; CHECK-X64-LABEL: callFunc:
76 ; CHECK-X64: jmp otherFunc
77 ; CHECK-X86-LABEL: _callFunc:
78 ; CHECK-X86: jmp _otherFunc
80 tail call void @otherFunc()
84 declare dso_local void @otherFunc()
86 ; CHECK-X64: .section .rdata$.refptr.var,"dr",discard,.refptr.var
87 ; CHECK-X64: .globl .refptr.var
88 ; CHECK-X64: .refptr.var:
89 ; CHECK-X64: .quad var
91 ; CHECK-X86: .section .rdata$.refptr._var,"dr",discard,.refptr._var
92 ; CHECK-X86: .globl .refptr._var
93 ; CHECK-X86: .refptr._var:
94 ; CHECK-X86: .long _var