38 lines · plain
1# RUN: not --crash llc -mtriple=aarch64-- -run-pass=legalizer %s -o - 2>&1 | FileCheck %s2 3# This is to demonstrate what kind of bugs we're missing w/o some kind4# of validation for LegalizerInfo: G_INTTOPTR could only be legal /5# could be legalized if its destination operand has a pointer type and6# its source - a scalar type. This is reversed in this test and the7# legalizer is expected to fail on it with an appropriate error8# message. Prior to LegalizerInfo::verify AArch64 legalizer had a9# subtle bug in its definition that caused it to accept the following10# MIR as legal. Namely, it checked that type index 0 is either s64 or11# p0 (in that order) and implicitly declared any type for type index 112# as legal. As LegalizerInfo::verify asserts on such a definition due13# to type index 1 not being covered it forces to review the definition14# and fix the mistake: check that type index 0 is p0 and type index 115# is s64 (in that order).16 17# CHECK: Bad machine code: inttoptr result type must be a pointer18# CHECK: Bad machine code: inttoptr source type must not be a pointer19# CHECK: LLVM ERROR: Found 2 machine code errors.20 21---22name: broken23alignment: 424tracksRegLiveness: true25registers:26 - { id: 0, class: _ }27 - { id: 1, class: _ }28body: |29 bb.1:30 liveins: $x031 32 %0:_(p0) = COPY $x033 %1:_(s64) = G_INTTOPTR %0(p0)34 $x0 = COPY %1(s64)35 RET_ReallyLR implicit $x036 37...38