summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang/0013-llvm-AARCH64-Add-support-for-.dword-directives.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/clang/clang/0013-llvm-AARCH64-Add-support-for-.dword-directives.patch')
-rw-r--r--recipes-devtools/clang/clang/0013-llvm-AARCH64-Add-support-for-.dword-directives.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0013-llvm-AARCH64-Add-support-for-.dword-directives.patch b/recipes-devtools/clang/clang/0013-llvm-AARCH64-Add-support-for-.dword-directives.patch
new file mode 100644
index 0000000..542658b
--- /dev/null
+++ b/recipes-devtools/clang/clang/0013-llvm-AARCH64-Add-support-for-.dword-directives.patch
@@ -0,0 +1,57 @@
1From f55e2d5f21917bca619db7aabffd9488748c8165 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 13/18] 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