1# RUN: not llc -o - %s -mtriple=x86_64-- -verify-machineinstrs -run-pass=none 2>&1 | FileCheck %s
2
3# CHECK: Bad machine code: Generic extend/truncate can not operate on pointers
4# CHECK-NEXT: - function:    bad_generic_extends_and_truncates
5# CHECK-NEXT: - basic block: %bb.1
6# CHECK-NEXT: - instruction: %t_p:_(s32) = G_TRUNC %p:_(p0)
7
8# CHECK: Bad machine code: Generic extend/truncate must be all-vector or all-scalar
9# CHECK-NEXT: - function:    bad_generic_extends_and_truncates
10# CHECK-NEXT: - basic block: %bb.2
11# CHECK-NEXT: - instruction: %se_i32:_(<2 x s64>) = G_SEXT %i32:_(s32)
12
13# CHECK: Bad machine code: Generic vector extend/truncate must preserve number of lanes
14# CHECK-NEXT: - function:    bad_generic_extends_and_truncates
15# CHECK-NEXT: - basic block: %bb.3
16# CHECK-NEXT: - instruction: %ze_v2i32:_(<4 x s64>) = G_ZEXT %v2i32:_(<2 x s32>)
17
18# CHECK: Bad machine code: Generic extend has destination type no larger than source
19# CHECK-NEXT: - function:    bad_generic_extends_and_truncates
20# CHECK-NEXT: - basic block: %bb.4
21# CHECK-NEXT: - instruction: %ae_i32:_(s32) = G_ANYEXT %i32:_(s32)
22
23# CHECK: Bad machine code: Generic truncate has destination type no smaller than source ***
24# CHECK-NEXT: - function:    bad_generic_extends_and_truncates
25# CHECK-NEXT: - basic block: %bb.5
26# CHECK-NEXT: - instruction: %ft_f32:_(s64) = G_FPTRUNC %f32:_(s32)
27
28
29# CHECK: Bad machine code: Generic extend/truncate can not operate on pointers
30# CHECK-NEXT: - function:    bad_generic_extends_and_truncates
31# CHECK-NEXT: - basic block: %bb.6
32# CHECK-NEXT: - instruction: %ze_v2i128:_(<4 x p0>) = G_ZEXT %v2i128:_(<2 x s128>)
33
34# CHECK: Bad machine code: Generic vector extend/truncate must preserve number of lanes
35# CHECK-NEXT: - function:    bad_generic_extends_and_truncates
36# CHECK-NEXT: - basic block: %bb.6
37# CHECK-NEXT: - instruction: %ze_v2i128:_(<4 x p0>) = G_ZEXT %v2i128:_(<2 x s128>)
38
39# CHECK: Bad machine code: Generic extend has destination type no larger than source
40# CHECK-NEXT: - function:    bad_generic_extends_and_truncates
41# CHECK-NEXT: - basic block: %bb.6
42# CHECK-NEXT: - instruction: %ze_v2i128:_(<4 x p0>) = G_ZEXT %v2i128:_(<2 x s128>)
43
44
45# CHECK: Bad machine code: Generic extend/truncate can not operate on pointers
46# CHECK-NEXT: - function:    bad_generic_extends_and_truncates
47# CHECK-NEXT: - basic block: %bb.6
48# CHECK-NEXT: - instruction: %fe_v2f128:_(p0) = G_FPEXT %v2f128:_(<2 x s128>)
49
50# CHECK: Bad machine code: Generic extend/truncate must be all-vector or all-scalar
51# CHECK-NEXT: - function:    bad_generic_extends_and_truncates
52# CHECK-NEXT: - basic block: %bb.6
53# CHECK-NEXT: - instruction: %fe_v2f128:_(p0) = G_FPEXT %v2f128:_(<2 x s128>)
54
55---
56name:              bad_generic_extends_and_truncates
57tracksRegLiveness: true
58body:              |
59  bb.0:
60    liveins: $rdi, $esi, $rdx, $xmm0, $ymm1, $ymm2
61
62    %p:_(p0) = COPY $rdi
63    %i32:_(s32) = COPY $esi
64    %v2i32:_(<2 x s32>) = COPY $rdx
65    %f32:_(s32) = COPY $xmm0
66    %v2i128:_(<2 x s128>) = COPY $ymm1
67    %v2f128:_(<2 x s128>) = COPY $ymm2
68
69  bb.1:
70    %t_p:_(s32) = G_TRUNC %p
71
72  bb.2:
73    %se_i32:_(<2 x s64>) = G_SEXT %i32
74
75  bb.3:
76    %ze_v2i32:_(<4 x s64>) = G_ZEXT %v2i32
77
78  bb.4:
79    %ae_i32:_(s32) = G_ANYEXT %i32
80
81  bb.5:
82    %ft_f32:_(s64) = G_FPTRUNC %f32
83
84  bb.6:
85    %ze_v2i128:_(<4 x p0>) = G_ZEXT %v2i128
86    %fe_v2f128:_(p0) = G_FPEXT %v2f128
87...
88