aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/GlobalISel/legalize-constant.mir
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/GlobalISel/legalize-constant.mir')
-rw-r--r--test/CodeGen/X86/GlobalISel/legalize-constant.mir43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/CodeGen/X86/GlobalISel/legalize-constant.mir b/test/CodeGen/X86/GlobalISel/legalize-constant.mir
new file mode 100644
index 000000000000..612d33a77fc9
--- /dev/null
+++ b/test/CodeGen/X86/GlobalISel/legalize-constant.mir
@@ -0,0 +1,43 @@
+# RUN: llc -mtriple=i386-linux-gnu -global-isel -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32
+# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
+
+--- |
+ define void @constInt_check() {
+ ret void
+ }
+
+...
+---
+name: constInt_check
+# ALL-LABEL: name: constInt_check
+registers:
+ - { id: 0, class: _ }
+ - { id: 1, class: _ }
+ - { id: 2, class: _ }
+ - { id: 3, class: _ }
+ - { id: 4, class: _ }
+body: |
+ bb.1 (%ir-block.0):
+ ; ALL: %5(s8) = G_CONSTANT i8 -1
+ ; ALL: %0(s1) = G_TRUNC %5(s8)
+ %0(s1) = G_CONSTANT i1 1
+
+ ; ALL: %1(s8) = G_CONSTANT i8 8
+ %1(s8) = G_CONSTANT i8 8
+
+ ; ALL: %2(s16) = G_CONSTANT i16 16
+ %2(s16) = G_CONSTANT i16 16
+
+ ; ALL: %3(s32) = G_CONSTANT i32 32
+ %3(s32) = G_CONSTANT i32 32
+
+ ; X64: %4(s64) = G_CONSTANT i64 64
+
+ ; X32: %6(s32) = G_CONSTANT i32 64
+ ; X32: %7(s32) = G_CONSTANT i32 0
+ ; X32: %4(s64) = G_MERGE_VALUES %6(s32), %7(s32)
+ %4(s64) = G_CONSTANT i64 64
+
+ RET 0
+...
+