MIR Parser: Allow the dollar characters in all of the identifier tokens.
[oota-llvm.git] / test / CodeGen / MIR / X86 / global-value-operands.mir
1 # RUN: llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s | FileCheck %s
2 # This test ensures that the MIR parser parses global value operands correctly.
3
4 --- |
5
6   @G = external global i32
7   @0 = external global i32
8
9   define i32 @inc() {
10   entry:
11     %a = load i32, i32* @G
12     %b = add i32 %a, 1
13     ret i32 %b
14   }
15
16   define i32 @inc2() {
17   entry:
18     %a = load i32, i32* @0
19     %b = add i32 %a, 1
20     ret i32 %b
21   }
22
23   @.$0  = external global i32
24   @-_-  = external global i32
25   @_-_a = external global i32
26   @$.-B = external global i32
27
28   define i32 @test() {
29   entry:
30     %a = load i32, i32* @.$0
31     store i32 %a, i32* @-_-
32     %b = load i32, i32* @_-_a
33     store i32 %b, i32* @$.-B
34     ret i32 %b
35   }
36
37 ...
38 ---
39 # CHECK: name: inc
40 name: inc
41 body:
42   - id: 0
43     name: entry
44     instructions:
45       # CHECK: - '%rax = MOV64rm %rip, 1, _, @G, _'
46       - '%rax = MOV64rm %rip, 1, _, @G, _'
47       - '%eax = MOV32rm %rax, 1, _, 0, _'
48       - '%eax = INC32r %eax, implicit-def %eflags'
49       - 'RETQ %eax'
50 ...
51 ---
52 # CHECK: name: inc2
53 name: inc2
54 body:
55   - id: 0
56     name: entry
57     instructions:
58       # CHECK: - '%rax = MOV64rm %rip, 1, _, @0, _'
59       - '%rax = MOV64rm %rip, 1, _, @0, _'
60       - '%eax = MOV32rm %rax, 1, _, 0, _'
61       - '%eax = INC32r %eax, implicit-def %eflags'
62       - 'RETQ %eax'
63 ...
64 ---
65 name:            test
66 body:
67   - id:              0
68     name:            entry
69     instructions:
70       # CHECK: , @".$0",
71       # CHECK: , @-_-,
72       # CHECK: , @_-_a,
73       # CHECK: , @"$.-B",
74       - '%rax = MOV64rm %rip, 1, _, @.$0, _'
75       - '%eax = MOV32rm killed %rax, 1, _, 0, _'
76       - '%rcx = MOV64rm %rip, 1, _, @-_-, _'
77       - 'MOV32mr killed %rcx, 1, _, 0, _, killed %eax'
78       - '%rax = MOV64rm %rip, 1, _, @_-_a, _'
79       - '%eax = MOV32rm killed %rax, 1, _, 0, _'
80       - '%rcx = MOV64rm %rip, 1, _, @$.-B, _'
81       - 'MOV32mr killed %rcx, 1, _, 0, _, %eax'
82       - 'RETQ %eax'
83 ...