summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2017-03-15 16:51:41 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2017-03-15 16:51:41 +0000
commit1a6deeefe05282e2967d8180e05f53a0f6887b56 (patch)
treebe28625758badd3a9f24c6ae72cbfd7aa0be0423
parent00c5343d65c6ab2a60e7726b551903fe12f79fec (diff)
downloadbcm5719-llvm-1a6deeefe05282e2967d8180e05f53a0f6887b56.tar.gz
bcm5719-llvm-1a6deeefe05282e2967d8180e05f53a0f6887b56.zip
[GlobalISel][AArch64] Add back constant select tests. NFC.
More of r297856. llvm-svn: 297859
-rw-r--r--llvm/test/CodeGen/AArch64/GlobalISel/select-constant.mir73
1 files changed, 73 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/select-constant.mir b/llvm/test/CodeGen/AArch64/GlobalISel/select-constant.mir
new file mode 100644
index 00000000000..b9953246666
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/select-constant.mir
@@ -0,0 +1,73 @@
+# RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck %s
+
+--- |
+ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
+
+ define i32 @const_s32() { ret i32 42 }
+ define i64 @const_s64() { ret i64 1234567890123 }
+
+ define i32 @fconst_s32() { ret i32 42 }
+ define i64 @fconst_s64() { ret i64 1234567890123 }
+...
+
+---
+# CHECK-LABEL: name: const_s32
+name: const_s32
+legalized: true
+regBankSelected: true
+registers:
+ - { id: 0, class: gpr }
+
+# CHECK: body:
+# CHECK: %0 = MOVi32imm 42
+body: |
+ bb.0:
+ %0(s32) = G_CONSTANT i32 42
+...
+
+---
+# CHECK-LABEL: name: const_s64
+name: const_s64
+legalized: true
+regBankSelected: true
+registers:
+ - { id: 0, class: gpr }
+
+# CHECK: body:
+# CHECK: %0 = MOVi64imm 1234567890123
+body: |
+ bb.0:
+ %0(s64) = G_CONSTANT i64 1234567890123
+...
+
+---
+# CHECK-LABEL: name: fconst_s32
+name: fconst_s32
+legalized: true
+regBankSelected: true
+registers:
+ - { id: 0, class: fpr }
+
+# CHECK: body:
+# CHECK: [[TMP:%[0-9]+]] = MOVi32imm 1080033280
+# CHECK: %0 = COPY [[TMP]]
+body: |
+ bb.0:
+ %0(s32) = G_FCONSTANT float 3.5
+...
+
+---
+# CHECK-LABEL: name: fconst_s64
+name: fconst_s64
+legalized: true
+regBankSelected: true
+registers:
+ - { id: 0, class: fpr }
+
+# CHECK: body:
+# CHECK: [[TMP:%[0-9]+]] = MOVi64imm 4607182418800017408
+# CHECK: %0 = COPY [[TMP]]
+body: |
+ bb.0:
+ %0(s64) = G_FCONSTANT double 1.0
+...
OpenPOWER on IntegriCloud