1 # RUN: llc -O0 -run-pass=legalizer %s -o - | FileCheck %s
3 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
4 target triple = "aarch64--"
6 define void @test_anyext_crash() {
11 %0 = trunc i16 0 to i8
12 %1 = uitofp i8 %0 to double
19 name: test_anyext_crash
23 - { id: 0, class: _, preferred-register: '' }
24 - { id: 1, class: _, preferred-register: '' }
25 - { id: 2, class: _, preferred-register: '' }
28 ; Check we don't crash due to trying to legalize a dead instruction.
29 ; CHECK-LABEL: test_anyext_crash
33 %0(s16) = G_CONSTANT i16 0
38 %1(s8) = G_TRUNC %0(s16)
39 %2(s64) = G_UITOFP %1(s8)