summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-10-04 08:50:08 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-10-04 08:50:08 +0000
commit099960d3222ded960033943a7b7a26340b0d7440 (patch)
tree833f6d17efac4934c4b255a2953e3582fbc151fd /llvm/test
parenta1a3f5c5e68793cb5bae5c798494e194cbe8ce58 (diff)
downloadbcm5719-llvm-099960d3222ded960033943a7b7a26340b0d7440.tar.gz
bcm5719-llvm-099960d3222ded960033943a7b7a26340b0d7440.zip
[MC] - Don't assert when non-english characters are used.
I found that llvm-mc does not like non-english characters even in comments, which it tries to tokenize. Problem happens because of functions like isdigit(), isalnum() which takes int argument and expects it is not negative. But at the same time MCParser uses char* to store input buffer poiner, char has signed value, so it is possible to pass negative value to one of functions from above and that triggers an assert. Testcase for demonstration is provided. To fix the issue helper functions were introduced in StringExtras.h Differential revision: https://reviews.llvm.org/D38461 llvm-svn: 314883
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/MC/AsmParser/non-english-characters.s14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/MC/AsmParser/non-english-characters.s b/llvm/test/MC/AsmParser/non-english-characters.s
new file mode 100644
index 00000000000..12d78ee83be
--- /dev/null
+++ b/llvm/test/MC/AsmParser/non-english-characters.s
@@ -0,0 +1,14 @@
+# RUN: llvm-mc -triple i386-linux-gnu -filetype=obj -o %t %s
+# RUN: llvm-readobj %t | FileCheck %s
+# CHECK: Format: ELF32-i386
+
+# 0bÑ
+# 0xÑ
+# .Ñ4
+# .XÑ
+# .1Ñ
+# .1eÑ
+# 0x.Ñ
+# 0x0pÑ
+.intel_syntax
+# 1Ñ
OpenPOWER on IntegriCloud