1 # RUN: llc -march=x86-64 -run-pass none -o - %s | FileCheck %s
2 # This test ensures that the MIR parser parses global value operands correctly.
6 @G = external global i32
7 @0 = external global i32
11 %a = load i32, i32* @G
18 %a = load i32, i32* @0
23 @.$0 = external global i32
24 @-_- = external global i32
25 @_-_a = external global i32
26 @$.-B = external global i32
30 %a = load i32, i32* @.$0
31 store i32 %a, i32* @-_-
32 %b = load i32, i32* @_-_a
33 store i32 %b, i32* @$.-B
37 @"\01Hello@$%09 \\ World," = external global i32
41 %a = load i32, i32* @"\01Hello@$%09 \\ World,"
47 %a = load i32, i32* @.$0
48 store i32 %a, i32* @-_-
49 %b = load i32, i32* @_-_a
50 store i32 %b, i32* @$.-B
56 %a = load i32, i32* @G
67 ; CHECK: $rax = MOV64rm $rip, 1, $noreg, @G, $noreg
68 $rax = MOV64rm $rip, 1, _, @G, _
69 $eax = MOV32rm $rax, 1, _, 0, _
70 $eax = INC32r $eax, implicit-def $eflags
78 ; CHECK: $rax = MOV64rm $rip, 1, $noreg, @0, $noreg
79 $rax = MOV64rm $rip, 1, _, @0, _
80 $eax = MOV32rm $rax, 1, _, 0, _
81 $eax = INC32r $eax, implicit-def $eflags
92 $rax = MOV64rm $rip, 1, _, @.$0, _
93 $eax = MOV32rm killed $rax, 1, _, 0, _
94 $rcx = MOV64rm $rip, 1, _, @-_-, _
95 MOV32mr killed $rcx, 1, _, 0, _, killed $eax
96 $rax = MOV64rm $rip, 1, _, @_-_a, _
97 $eax = MOV32rm killed $rax, 1, _, 0, _
98 $rcx = MOV64rm $rip, 1, _, @$.-B, _
99 MOV32mr killed $rcx, 1, _, 0, _, $eax
106 ; CHECK: , @"\01Hello@$%09 \5C World,",
107 $rax = MOV64rm $rip, 1, _, @"\01Hello@$%09 \\ World,", _
108 $eax = MOV32rm killed $rax, 1, _, 0, _
118 ; CHECK: , @_-_a + 4,
119 ; CHECK: , @"$.-B" - 8,
120 $rax = MOV64rm $rip, 1, _, @.$0 + 0, _
121 $eax = MOV32rm killed $rax, 1, _, 0, _
122 $rcx = MOV64rm $rip, 1, _, @-_- - 0, _
123 MOV32mr killed $rcx, 1, _, 0, _, killed $eax
124 $rax = MOV64rm $rip, 1, _, @_-_a + 4, _
125 $eax = MOV32rm killed $rax, 1, _, 0, _
126 $rcx = MOV64rm $rip, 1, _, @$.-B - 8, _
127 MOV32mr killed $rcx, 1, _, 0, _, $eax
135 ; CHECK: $rax = MOV64rm $rip, 1, $noreg, target-flags(x86-gotpcrel) @G, $noreg
136 $rax = MOV64rm $rip, 1, _, target-flags(x86-gotpcrel) @G, _
137 $eax = MOV32rm $rax, 1, _, 0, _
138 $eax = INC32r $eax, implicit-def $eflags