aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/GlobalISel/legalize-trunc.mir
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/GlobalISel/legalize-trunc.mir')
-rw-r--r--test/CodeGen/X86/GlobalISel/legalize-trunc.mir31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/CodeGen/X86/GlobalISel/legalize-trunc.mir b/test/CodeGen/X86/GlobalISel/legalize-trunc.mir
new file mode 100644
index 000000000000..6b390d990ecf
--- /dev/null
+++ b/test/CodeGen/X86/GlobalISel/legalize-trunc.mir
@@ -0,0 +1,31 @@
+# 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 @trunc_check() {
+ ret void
+ }
+
+...
+---
+name: trunc_check
+# ALL-LABEL: name: trunc_check
+registers:
+ - { id: 0, class: _ }
+ - { id: 1, class: _ }
+ - { id: 2, class: _ }
+ - { id: 3, class: _ }
+body: |
+ bb.1 (%ir-block.0):
+ %0(s32) = IMPLICIT_DEF
+ ; ALL: %1(s1) = G_TRUNC %0(s32)
+ %1(s1) = G_TRUNC %0(s32)
+
+ ; ALL: %2(s8) = G_TRUNC %0(s32)
+ %2(s8) = G_TRUNC %0(s32)
+
+ ; ALL: %3(s16) = G_TRUNC %0(s32)
+ %3(s16) = G_TRUNC %0(s32)
+ RET 0
+
+...
+