summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-03-17 17:13:54 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-03-17 17:13:54 +0000
commit11543a9953111cd29623653d5f9ca5749f05b8d6 (patch)
treeccd76e775f53a933c0aa6310f7530cdd402406c7 /llvm/test
parent24381f1cb74d230d029e4804f8eaf46b7ff5deb2 (diff)
downloadbcm5719-llvm-11543a9953111cd29623653d5f9ca5749f05b8d6.tar.gz
bcm5719-llvm-11543a9953111cd29623653d5f9ca5749f05b8d6.zip
ARM IAS: support .thumb_set
This performs the equivalent of a .set directive in that it creates a symbol which is an alias for another symbol or value which may possibly be yet undefined. This directive also has the added property in that it marks the aliased symbol as being a thumb function entry point, in the same way that the .thumb_func directive does. The current implementation fails one test due to an unrelated issue. Functions within .thumb sections are not marked as thumb_func. The result is that the aliasee function is not valued correctly. llvm-svn: 204059
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/MC/ARM/thumb_set-diagnostics.s43
-rw-r--r--llvm/test/MC/ARM/thumb_set.s140
2 files changed, 183 insertions, 0 deletions
diff --git a/llvm/test/MC/ARM/thumb_set-diagnostics.s b/llvm/test/MC/ARM/thumb_set-diagnostics.s
new file mode 100644
index 00000000000..5f1844de01f
--- /dev/null
+++ b/llvm/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/llvm/test/MC/ARM/thumb_set.s b/llvm/test/MC/ARM/thumb_set.s
new file mode 100644
index 00000000000..7381a98134d
--- /dev/null
+++ b/llvm/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: }
+
OpenPOWER on IntegriCloud