summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/MIR
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-07-20 20:31:01 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-07-20 20:31:01 +0000
commitb29554dab927a92dda672cb597d3675f457a4ca2 (patch)
tree056fc98353fdcc8ee436ba3f3fb491df7099beae /llvm/test/CodeGen/MIR
parentd285d3fbb7bed80d324d0ed4eae7f956a1fe11a3 (diff)
downloadbcm5719-llvm-b29554dab927a92dda672cb597d3675f457a4ca2.tar.gz
bcm5719-llvm-b29554dab927a92dda672cb597d3675f457a4ca2.zip
MIR Parser: Add support for quoted named global value operands.
This commit extends the machine instruction lexer and implements support for the quoted global value tokens. With this change the syntax for the global value identifier tokens becomes identical to the syntax for the global identifier tokens from the LLVM's assembly language. Reviewers: Duncan P. N. Exon Smith llvm-svn: 242702
Diffstat (limited to 'llvm/test/CodeGen/MIR')
-rw-r--r--llvm/test/CodeGen/MIR/X86/global-value-operands.mir19
-rw-r--r--llvm/test/CodeGen/MIR/X86/missing-closing-quote.mir24
2 files changed, 43 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/MIR/X86/global-value-operands.mir b/llvm/test/CodeGen/MIR/X86/global-value-operands.mir
index 3e4710d33f4..775a01ba003 100644
--- a/llvm/test/CodeGen/MIR/X86/global-value-operands.mir
+++ b/llvm/test/CodeGen/MIR/X86/global-value-operands.mir
@@ -34,6 +34,14 @@
ret i32 %b
}
+ @"\01Hello@$%09 \\ World," = external global i32
+
+ define i32 @test2() {
+ entry:
+ %a = load i32, i32* @"\01Hello@$%09 \\ World,"
+ ret i32 %a
+ }
+
...
---
# CHECK: name: inc
@@ -81,3 +89,14 @@ body:
- 'MOV32mr killed %rcx, 1, _, 0, _, %eax'
- 'RETQ %eax'
...
+---
+name: test2
+body:
+ - id: 0
+ name: entry
+ instructions:
+ # CHECK: , @"\01Hello@$%09 \5C World,",
+ - '%rax = MOV64rm %rip, 1, _, @"\01Hello@$%09 \\ World,", _'
+ - '%eax = MOV32rm killed %rax, 1, _, 0, _'
+ - 'RETQ %eax'
+...
diff --git a/llvm/test/CodeGen/MIR/X86/missing-closing-quote.mir b/llvm/test/CodeGen/MIR/X86/missing-closing-quote.mir
new file mode 100644
index 00000000000..f188d3ad8cf
--- /dev/null
+++ b/llvm/test/CodeGen/MIR/X86/missing-closing-quote.mir
@@ -0,0 +1,24 @@
+# RUN: not llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
+
+--- |
+
+ @"quoted name" = external global i32
+
+ define i32 @test() {
+ entry:
+ %a = load i32, i32* @"quoted name"
+ ret i32 %a
+ }
+
+...
+---
+name: test
+body:
+ - id: 0
+ name: entry
+ instructions:
+ # CHECK: [[@LINE+1]]:53: end of machine instruction reached before the closing '"'
+ - '%rax = MOV64rm %rip, 1, _, @"quoted name, _'
+ - '%eax = MOV32rm killed %rax, 1, _, 0, _'
+ - 'RETQ %eax'
+...
OpenPOWER on IntegriCloud