1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=i386-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=X32
3 # RUN: llc -O0 -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=X64
5 define void @trunc_check() {
19 ; X32-LABEL: name: trunc_check
20 ; X32: [[DEF:%[0-9]+]]:_(s32) = IMPLICIT_DEF
21 ; X32-NEXT: [[DEF1:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
22 ; X32-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[DEF]](s32)
23 ; X32-NEXT: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 1
24 ; X32-NEXT: [[AND:%[0-9]+]]:_(s8) = G_AND [[TRUNC]], [[C]]
25 ; X32-NEXT: G_STORE [[AND]](s8), [[DEF1]](p0) :: (store (s1))
26 ; X32-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[DEF]](s32)
27 ; X32-NEXT: G_STORE [[TRUNC1]](s8), [[DEF1]](p0) :: (store (s8))
28 ; X32-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
29 ; X32-NEXT: G_STORE [[TRUNC2]](s16), [[DEF1]](p0) :: (store (s16))
32 ; X64-LABEL: name: trunc_check
33 ; X64: [[DEF:%[0-9]+]]:_(s32) = IMPLICIT_DEF
34 ; X64-NEXT: [[DEF1:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
35 ; X64-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[DEF]](s32)
36 ; X64-NEXT: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 1
37 ; X64-NEXT: [[AND:%[0-9]+]]:_(s8) = G_AND [[TRUNC]], [[C]]
38 ; X64-NEXT: G_STORE [[AND]](s8), [[DEF1]](p0) :: (store (s1))
39 ; X64-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[DEF]](s32)
40 ; X64-NEXT: G_STORE [[TRUNC1]](s8), [[DEF1]](p0) :: (store (s8))
41 ; X64-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
42 ; X64-NEXT: G_STORE [[TRUNC2]](s16), [[DEF1]](p0) :: (store (s16))
44 %0(s32) = IMPLICIT_DEF
45 %1(s1) = G_TRUNC %0(s32)
46 %4:_(p0) = G_IMPLICIT_DEF
47 G_STORE %1, %4 :: (store (s1))
49 %2(s8) = G_TRUNC %0(s32)
50 G_STORE %2, %4 :: (store (s8))
52 %3(s16) = G_TRUNC %0(s32)
53 G_STORE %3, %4 :: (store (s16))