summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/ARM')
-rw-r--r--llvm/test/CodeGen/ARM/build-attributes-fn-attr0.ll11
-rw-r--r--llvm/test/CodeGen/ARM/build-attributes-fn-attr1.ll17
-rw-r--r--llvm/test/CodeGen/ARM/build-attributes-fn-attr2.ll16
-rw-r--r--llvm/test/CodeGen/ARM/build-attributes-fn-attr3.ll17
-rw-r--r--llvm/test/CodeGen/ARM/build-attributes-fn-attr4.ll16
-rw-r--r--llvm/test/CodeGen/ARM/build-attributes-fn-attr5.ll16
-rw-r--r--llvm/test/CodeGen/ARM/build-attributes-fn-attr6.ll22
7 files changed, 115 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/build-attributes-fn-attr0.ll b/llvm/test/CodeGen/ARM/build-attributes-fn-attr0.ll
new file mode 100644
index 00000000000..2fb3e032e5d
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/build-attributes-fn-attr0.ll
@@ -0,0 +1,11 @@
+; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed
+; as function attributes, which map on to build attributes ABI_FP_exceptions
+; ABI_FP_denormal. In the backend we therefore have a check to see if all
+; functions have consistent function attributes values. This check also returns
+; true when the compilation unit does not have any functions (i.e. the
+; attributes are consistent), which is what we check with this regression test.
+
+; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15 | FileCheck %s --check-prefix=CHECK
+
+; CHECK: .eabi_attribute 20, 2
+; CHECK: .eabi_attribute 21, 0
diff --git a/llvm/test/CodeGen/ARM/build-attributes-fn-attr1.ll b/llvm/test/CodeGen/ARM/build-attributes-fn-attr1.ll
new file mode 100644
index 00000000000..4d6ce7c9756
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/build-attributes-fn-attr1.ll
@@ -0,0 +1,17 @@
+; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed as
+; function attributes, which map on to build attributes ABI_FP_exceptions ABI_FP_denormal.
+; In the backend we have a check to see if all functions have consistent function
+; attributes values. This checks the "default" behaviour when these FP function
+; attributes are not set at all.
+
+; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15 | FileCheck %s --check-prefix=CHECK
+
+; CHECK: .eabi_attribute 20, 1
+; CHECK: .eabi_attribute 21, 1
+
+define i32 @foo_no_fn_attr() local_unnamed_addr #0 {
+entry:
+ ret i32 42
+}
+
+attributes #0 = { minsize norecurse nounwind optsize readnone }
diff --git a/llvm/test/CodeGen/ARM/build-attributes-fn-attr2.ll b/llvm/test/CodeGen/ARM/build-attributes-fn-attr2.ll
new file mode 100644
index 00000000000..0272d613991
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/build-attributes-fn-attr2.ll
@@ -0,0 +1,16 @@
+; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed
+; as function attributes, which map on to build attributes ABI_FP_exceptions
+; ABI_FP_denormal. In the backend we therefore have a check to see if all
+; functions have consistent function attributes values.
+; Here we test correct output for no-trapping-math=false
+
+; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15 | FileCheck %s --check-prefix=CHECK
+
+; CHECK: .eabi_attribute 21, 1
+
+define i32 @foo() local_unnamed_addr #0 {
+entry:
+ ret i32 42
+}
+
+attributes #0 = { minsize norecurse nounwind optsize readnone "no-trapping-math"="false" }
diff --git a/llvm/test/CodeGen/ARM/build-attributes-fn-attr3.ll b/llvm/test/CodeGen/ARM/build-attributes-fn-attr3.ll
new file mode 100644
index 00000000000..a454abac3b5
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/build-attributes-fn-attr3.ll
@@ -0,0 +1,17 @@
+; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed
+; as function attributes, which map on to build attributes ABI_FP_exceptions
+; ABI_FP_denormal. In the backend we therefore have a check to see if all
+; functions have consistent function attributes values.
+; Here we check values no-trapping-math=true and denormal-fp-math=ieee.
+
+; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15 | FileCheck %s --check-prefix=CHECK
+
+; CHECK: .eabi_attribute 20, 1
+; CHECK: .eabi_attribute 21, 0
+
+define i32 @foo() local_unnamed_addr #0 {
+entry:
+ ret i32 42
+}
+
+attributes #0 = { minsize norecurse nounwind optsize readnone "no-trapping-math"="true" "denormal-fp-math"="ieee"}
diff --git a/llvm/test/CodeGen/ARM/build-attributes-fn-attr4.ll b/llvm/test/CodeGen/ARM/build-attributes-fn-attr4.ll
new file mode 100644
index 00000000000..6d2faac0052
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/build-attributes-fn-attr4.ll
@@ -0,0 +1,16 @@
+; Check FP option -fdenormal-fp-math. This passed as function attribute,
+; which map on to build attributes ABI_FP_denormal. In the backend we
+; therefore have a check to see if all functions have consistent function
+; attributes values.
+; Here we check the denormal-fp-math=positive-zero value.
+
+; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15 | FileCheck %s --check-prefix=CHECK
+
+; CHECK: .eabi_attribute 20, 0
+
+define i32 @foo1() local_unnamed_addr #0 {
+entry:
+ ret i32 42
+}
+
+attributes #0 = { minsize norecurse nounwind optsize readnone "denormal-fp-math"="positive-zero"}
diff --git a/llvm/test/CodeGen/ARM/build-attributes-fn-attr5.ll b/llvm/test/CodeGen/ARM/build-attributes-fn-attr5.ll
new file mode 100644
index 00000000000..e631d2e3b55
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/build-attributes-fn-attr5.ll
@@ -0,0 +1,16 @@
+; Check FP option -fdenormal-fp-math. This passed as function attribute,
+; which map on to build attributes ABI_FP_denormal. In the backend we
+; therefore have a check to see if all functions have consistent function
+; attributes values.
+; Here we check the denormal-fp-math=preserve-sign value.
+
+; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15 | FileCheck %s --check-prefix=CHECK
+
+; CHECK: .eabi_attribute 20, 2
+
+define i32 @foo1() local_unnamed_addr #0 {
+entry:
+ ret i32 42
+}
+
+attributes #0 = { minsize norecurse nounwind optsize readnone "denormal-fp-math"="preserve-sign"}
diff --git a/llvm/test/CodeGen/ARM/build-attributes-fn-attr6.ll b/llvm/test/CodeGen/ARM/build-attributes-fn-attr6.ll
new file mode 100644
index 00000000000..57443b0af0d
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/build-attributes-fn-attr6.ll
@@ -0,0 +1,22 @@
+; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed
+; as function attributes, which map on to build attributes ABI_FP_exceptions
+; ABI_FP_denormal. In the backend we therefore have a check to see if all
+; functions have consistent function attributes values. Here we check two
+; functions have inconsistent values, and that a default is returned.
+
+; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15 | FileCheck %s --check-prefix=CHECK
+
+; CHECK: .eabi_attribute 20, 1
+
+define i32 @foo1() local_unnamed_addr #0 {
+entry:
+ ret i32 42
+}
+
+define i32 @foo2() local_unnamed_addr #1 {
+entry:
+ ret i32 42
+}
+
+attributes #0 = { minsize norecurse nounwind optsize readnone "denormal-fp-math"="preserve-sign"}
+attributes #0 = { minsize norecurse nounwind optsize readnone "denormal-fp-math"="positive-zero"}
OpenPOWER on IntegriCloud