summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/arm-abi-attr.ll
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-02 13:40:08 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-02 13:40:08 +0000
commita21a8a863ddfda6882fdbdc5a714030b4bf49aec (patch)
tree61a6a7925f8ad6ea537f59c822728c725711accf /test/CodeGen/ARM/arm-abi-attr.ll
parente7d30fb809cf05ebc3e8e1025d0774f731986763 (diff)
Make the ARM ABI selectable via SubtargetFeature.
This patch makes it possible to select the ABI with -mattr. It will be used to forward clang's -target-abi option to llvm's CodeGen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198304 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/arm-abi-attr.ll')
-rw-r--r--test/CodeGen/ARM/arm-abi-attr.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/arm-abi-attr.ll b/test/CodeGen/ARM/arm-abi-attr.ll
new file mode 100644
index 00000000000..f3923ae5cc8
--- /dev/null
+++ b/test/CodeGen/ARM/arm-abi-attr.ll
@@ -0,0 +1,28 @@
+; RUN: llc -mtriple=arm-linux < %s | FileCheck %s --check-prefix=APCS
+; RUN: llc -mtriple=arm-linux -mattr=apcs < %s | \
+; RUN: FileCheck %s --check-prefix=APCS
+; RUN: llc -mtriple=arm-linux-gnueabi -mattr=apcs < %s | \
+; RUN: FileCheck %s --check-prefix=APCS
+
+; RUN: llc -mtriple=arm-linux-gnueabi < %s | FileCheck %s --check-prefix=AAPCS
+; RUN: llc -mtriple=arm-linux-gnueabi -mattr=aapcs < %s | \
+; RUN: FileCheck %s --check-prefix=AAPCS
+; RUN: llc -mtriple=arm-linux-gnu -mattr=aapcs < %s | \
+; RUN: FileCheck %s --check-prefix=AAPCS
+
+; The stack is 8 byte aligned on AAPCS and 4 on APCS, so we should get a BIC
+; only on APCS.
+
+define void @g() {
+; APCS: sub sp, sp, #8
+; APCS: bic sp, sp, #7
+
+; AAPCS: sub sp, sp, #8
+; AAPCS-NOT: bic
+
+ %c = alloca i8, align 8
+ call void @f(i8* %c)
+ ret void
+}
+
+declare void @f(i8*)