summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-01-31 13:25:54 -0800
committerKhem Raj <raj.khem@gmail.com>2019-01-31 20:11:09 -0800
commit8f4d1ca8e2ddec3dd2dbfb924ee44fae8ce20ac4 (patch)
treed09e2745fb6fb4a64d74e87a69afadaab82912b7
parent11fe47dbfed41218df9f6c5e4f4e75bee0c4ad77 (diff)
downloadmeta-clang-8f4d1ca8e2ddec3dd2dbfb924ee44fae8ce20ac4.tar.gz
llvm: Add .dword support for aarch64 MC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch57
-rw-r--r--recipes-devtools/clang/common.inc1
2 files changed, 58 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch b/recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch
new file mode 100644
index 0000000..4ac102d
--- /dev/null
+++ b/recipes-devtools/clang/clang/0017-llvm-AARCH64-Add-support-for-.dword-directives.patch
@@ -0,0 +1,57 @@
1From 2c85adc50b677e9094932828aa7a51affde892fb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Jan 2019 10:53:22 -0800
4Subject: [PATCH] llvm: [AARCH64] Add support for .dword directives
5
6This directives is supported in GNU assembler, Add support via addAliasForDirective.
7Add a testcase to check for data directives
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 .../AArch64/AsmParser/AArch64AsmParser.cpp | 3 ++-
12 llvm/test/MC/AArch64/data-directives-invalid.s | 16 ++++++++++++++++
13 2 files changed, 18 insertions(+), 1 deletion(-)
14 create mode 100644 llvm/test/MC/AArch64/data-directives-invalid.s
15
16diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
17index 6cc9b67e4d2..c43b9827cbd 100644
18--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
19+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
20@@ -244,10 +244,11 @@ public:
21
22 // Alias .hword/.word/xword to the target-independent .2byte/.4byte/.8byte
23 // directives as they have the same form and semantics:
24- /// ::= (.hword | .word | .xword ) [ expression (, expression)* ]
25+ /// ::= (.hword | .word | .xword | .dword ) [ expression (, expression)* ]
26 Parser.addAliasForDirective(".hword", ".2byte");
27 Parser.addAliasForDirective(".word", ".4byte");
28 Parser.addAliasForDirective(".xword", ".8byte");
29+ Parser.addAliasForDirective(".dword", ".8byte");
30
31 // Initialize the set of available features.
32 setAvailableFeatures(ComputeAvailableFeatures(getSTI().getFeatureBits()));
33diff --git a/llvm/test/MC/AArch64/data-directives-invalid.s b/llvm/test/MC/AArch64/data-directives-invalid.s
34new file mode 100644
35index 00000000000..7b59a2e60fa
36--- /dev/null
37+++ b/llvm/test/MC/AArch64/data-directives-invalid.s
38@@ -0,0 +1,16 @@
39+# RUN: not llvm-mc -triple aarch64 < %s 2>&1 | FileCheck %s
40+
41+# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.hword' directive
42+.hword 0xffffa
43+# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.2byte' directive
44+.2byte 0xffffa
45+# CHECK: [[@LINE+1]]:7: error: out of range literal value in '.word' directive
46+.word 0xffffffffa
47+# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.4byte' directive
48+.4byte 0xffffffffa
49+# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.dword' directive
50+.dword 0xffffffffffffffffa
51+# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.xword' directive
52+.xword 0xffffffffffffffffa
53+# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.8byte' directive
54+.8byte 0xffffffffffffffffa
55--
562.20.1
57
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc
index 0d9445a..65589f9 100644
--- a/recipes-devtools/clang/common.inc
+++ b/recipes-devtools/clang/common.inc
@@ -25,6 +25,7 @@ SRC_URI = "\
25 file://0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ 25 file://0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \
26 file://0015-compiler-rt-Disable-tsan-on-OE-glibc.patch \ 26 file://0015-compiler-rt-Disable-tsan-on-OE-glibc.patch \
27 file://0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch \ 27 file://0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch \
28 file://0017-llvm-AARCH64-Add-support-for-.dword-directives.patch \
28" 29"
29 30
30# Fallback to no-PIE if not set 31# Fallback to no-PIE if not set