summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/interwork.ll
diff options
context:
space:
mode:
authorPablo Barrio <pablo.barrio@arm.com>2016-09-13 12:18:15 +0000
committerPablo Barrio <pablo.barrio@arm.com>2016-09-13 12:18:15 +0000
commitbb6984d4019fe530663f93bcd813deb9b7c1b072 (patch)
tree155cfe6c994f4f113f6f3d7608fdd96fa9b791c0 /llvm/test/CodeGen/ARM/interwork.ll
parentd246c598deef73bdd751c822cb847c0caa3a3ffb (diff)
downloadbcm5719-llvm-bb6984d4019fe530663f93bcd813deb9b7c1b072.tar.gz
bcm5719-llvm-bb6984d4019fe530663f93bcd813deb9b7c1b072.zip
[ARM] Add ".code 32" to functions in the ARM instruction set
Before, only Thumb functions were marked as ".code 16". These ".code x" directives are effective until the next directive of its kind is encountered. Therefore, in code with interleaved ARM and Thumb functions, it was possible to declare a function as ARM and end up with a Thumb function after assembly. A test has been added. An existing test has also been fixed to take this change into account. Reviewers: aschwaighofer, t.p.northover, jmolloy, rengolin Subscribers: aemerson, rengolin, llvm-commits Differential Revision: https://reviews.llvm.org/D24337 llvm-svn: 281324
Diffstat (limited to 'llvm/test/CodeGen/ARM/interwork.ll')
-rw-r--r--llvm/test/CodeGen/ARM/interwork.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/interwork.ll b/llvm/test/CodeGen/ARM/interwork.ll
new file mode 100644
index 00000000000..9a75cdea6fe
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/interwork.ll
@@ -0,0 +1,23 @@
+; One file may have multiple functions targeted at different (ARM, Thumb)
+; instruction sets. Passing this information to the linker and the assembler
+; is done through the ".code 16" and ".code 32" directives.
+;
+; RUN: llc -mtriple=arm-arm-none-eabi %s -o - | FileCheck %s
+
+define void @ft() #0 {
+; CHECK: .code 16
+; CHECK: .thumb_func
+; CHECK-LABEL: ft:
+entry:
+ ret void
+}
+
+define void @fz() #1 {
+; CHECK: .code 32
+; CHECK-LABEL: fz:
+entry:
+ ret void
+}
+
+attributes #0 = { "target-features"="+thumb-mode" }
+attributes #1 = { "target-features"="-thumb-mode" }
OpenPOWER on IntegriCloud