summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-03-20 06:05:33 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-03-20 06:05:33 +0000
commit9320b807aab66524522421dc7af040c4126fa235 (patch)
treeb2f712b83eac88df461c8a21f95864671f541881 /test
parentbadf4cb75ad7d0a435bb804e014f8b36a85a7844 (diff)
downloadllvm-9320b807aab66524522421dc7af040c4126fa235.tar.gz
llvm-9320b807aab66524522421dc7af040c4126fa235.tar.bz2
llvm-9320b807aab66524522421dc7af040c4126fa235.tar.xz
Reapply 'ARM IAS: support .thumb_set'
Re-apply the change after it was reverted to do conflicts due to another change being reverted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204306 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/ARM/thumb_set-diagnostics.s43
-rw-r--r--test/MC/ARM/thumb_set.s140
2 files changed, 183 insertions, 0 deletions
diff --git a/test/MC/ARM/thumb_set-diagnostics.s b/test/MC/ARM/thumb_set-diagnostics.s
new file mode 100644
index 0000000000..5f1844de01
--- /dev/null
+++ b/test/MC/ARM/thumb_set-diagnostics.s
@@ -0,0 +1,43 @@
+@ RUN: not llvm-mc -triple armv7-eabi -o /dev/null 2>&1 %s | FileCheck %s
+
+ .syntax unified
+
+ .thumb
+
+ .thumb_set
+
+@ CHECK: error: expected identifier after '.thumb_set'
+@ CHECK: .thumb_set
+@ CHECL: ^
+
+ .thumb_set ., 0x0b5e55ed
+
+@ CHECK: error: expected identifier after '.thumb_set'
+@ CHECK: .thumb_set ., 0x0b5e55ed
+@ CHECK: ^
+
+ .thumb_set labelled, 0x1abe11ed
+ .thumb_set invalid, :lower16:labelled
+
+@ CHECK: error: unknown token in expression
+@ CHECK: .thumb_set invalid, :lower16:labelled
+@ CHECK: ^
+
+ .thumb_set missing_comma
+
+@ CHECK: error: expected comma after name 'missing_comma'
+@ CHECK: .thumb_set missing_comma
+@ CHECK: ^
+
+ .thumb_set missing_expression,
+
+@ CHECK: error: missing expression
+@ CHECK: .thumb_set missing_expression,
+@ CHECK: ^
+
+ .thumb_set trailer_trash, 0x11fe1e55,
+
+@ CHECK: error: unexpected token
+@ CHECK: .thumb_set trailer_trash, 0x11fe1e55,
+@ CHECK: ^
+
diff --git a/test/MC/ARM/thumb_set.s b/test/MC/ARM/thumb_set.s
new file mode 100644
index 0000000000..7381a98134
--- /dev/null
+++ b/test/MC/ARM/thumb_set.s
@@ -0,0 +1,140 @@
+@ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s | llvm-readobj -t \
+@ RUN: | FileCheck %s
+
+ .syntax unified
+
+ .arm
+
+ .type arm_func,%function
+arm_func:
+ nop
+
+ .thumb_set alias_arm_func, arm_func
+
+ .thumb
+
+ .type thumb_func,%function
+ .thumb_func
+thumb_func:
+ nop
+
+ .thumb_set alias_thumb_func, thumb_func
+
+ .thumb_set seedless, 0x5eed1e55
+ .thumb_set eggsalad, seedless + 0x87788358
+ .thumb_set faceless, ~eggsalad + 0xe133c002
+
+ .thumb_set alias_undefined_data, badblood
+
+ .data
+
+ .type badblood,%object
+badblood:
+ .long 0xbadb100d
+
+ .type bedazzle,%object
+bedazzle:
+ .long 0xbeda221e
+
+ .text
+ .thumb
+
+ .thumb_set alias_defined_data, bedazzle
+
+ .type alpha,%function
+alpha:
+ nop
+
+ .type beta,%function
+beta:
+ bkpt
+
+ .thumb_set beta, alpha
+
+ .thumb_set alias_undefined, undefined
+
+@ CHECK: Symbol {
+@ CHECK: Name: alias_arm_func
+@ CHECK: Value: 0x1
+@ CHECK: Type: Function
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: alias_defined_data
+@ CHECK: Value: 0x5
+@ CHECK: Type: Function
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: alias_thumb_func
+@ CHECK: Value: 0x5
+@ CHECK: Type: Function
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: alias_undefined_data
+@ CHECK: Value: 0x0
+@ CHECK: Type: Object
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: alpha
+@ CHECK: Value: 0x6
+@ XFAIL-CHECK: Value: 0x7
+@ CHECK: Type: Function
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: arm_func
+@ CHECK: Value: 0x0
+@ CHECK: Type: Function
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: bedazzle
+@ CHECK: Value: 0x4
+@ CHECK: Type: Object
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: beta
+@ CHECK: Value: 0x7
+@ CHECK: Type: Function
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: eggsalad
+@ CHECK: Value: 0xE665A1AD
+@ CHECK: Type: Function
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: faceless
+@ CHECK: Value: 0xFACE1E55
+@ CHECK: Type: Function
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: seedless
+@ CHECK: Value: 0x5EED1E55
+@ CHECK: Type: Function
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: thumb_func
+@ CHECK: Value: 0x5
+@ CHECK: Type: Function
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: badblood
+@ CHECK: Value: 0x0
+@ CHECK: Type: Object
+@ CHECK: }
+
+@ CHECK: Symbol {
+@ CHECK: Name: undefined
+@ CHECK: Value: 0x0
+@ CHECK: Type: None
+@ CHECK: }
+