summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/AsmParser
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-02-14 16:34:27 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-02-14 16:34:27 +0000
commit22c38a074890361bd615e4aad66f0a95db684a39 (patch)
tree64482372331030307498e7bf73f6a06efd2997c0 /llvm/test/MC/AsmParser
parent3f60b0b3f4e4eca2771bcba454c115b4cae7da11 (diff)
downloadbcm5719-llvm-22c38a074890361bd615e4aad66f0a95db684a39.tar.gz
bcm5719-llvm-22c38a074890361bd615e4aad66f0a95db684a39.zip
Store defined macros in MCContext.
So that macros defined in inline assembly blocks are available to the whole file. This provides a consistent behavior with other assembly directives, since equations for example are already preserved between inline assembly blocks. PR: 36110 Patch by Roger! llvm-svn: 325139
Diffstat (limited to 'llvm/test/MC/AsmParser')
-rw-r--r--llvm/test/MC/AsmParser/inline_macro_duplication.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/MC/AsmParser/inline_macro_duplication.ll b/llvm/test/MC/AsmParser/inline_macro_duplication.ll
new file mode 100644
index 00000000000..9d7e22fde7b
--- /dev/null
+++ b/llvm/test/MC/AsmParser/inline_macro_duplication.ll
@@ -0,0 +1,8 @@
+; RUN: not llc < %s 2>&1 | FileCheck %s
+
+define void @test() {
+ call void asm sideeffect ".macro FOO\0A.endm", "~{dirflag},~{fpsr},~{flags}"() #1
+ call void asm sideeffect ".macro FOO\0A.endm", "~{dirflag},~{fpsr},~{flags}"() #1
+; CHECK: error: macro 'FOO' is already defined
+ ret void
+}
OpenPOWER on IntegriCloud