2020-02-12 15:01:35 +08:00
|
|
|
# RUN: not --crash llc -mtriple=aarch64-- -run-pass=legalizer %s -o - 2>&1 | FileCheck %s
|
2018-05-31 06:10:04 +08:00
|
|
|
|
|
|
|
# This is to demonstrate what kind of bugs we're missing w/o some kind
|
|
|
|
# of validation for LegalizerInfo: G_INTTOPTR could only be legal /
|
|
|
|
# could be legalized if its destination operand has a pointer type and
|
|
|
|
# its source - a scalar type. This is reversed in this test and the
|
|
|
|
# legalizer is expected to fail on it with an appropriate error
|
|
|
|
# message. Prior to LegalizerInfo::verify AArch64 legalizer had a
|
|
|
|
# subtle bug in its definition that caused it to accept the following
|
|
|
|
# MIR as legal. Namely, it checked that type index 0 is either s64 or
|
|
|
|
# p0 (in that order) and implicitly declared any type for type index 1
|
|
|
|
# as legal. As LegalizerInfo::verify asserts on such a definition due
|
|
|
|
# to type index 1 not being covered it forces to review the definition
|
|
|
|
# and fix the mistake: check that type index 0 is p0 and type index 1
|
|
|
|
# is s64 (in that order).
|
|
|
|
|
2019-01-30 07:29:00 +08:00
|
|
|
# CHECK: Bad machine code: inttoptr result type must be a pointer
|
|
|
|
# CHECK: Bad machine code: inttoptr source type must not be a pointer
|
|
|
|
# CHECK: LLVM ERROR: Found 2 machine code errors.
|
2018-05-31 06:10:04 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: broken
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 4
|
2018-05-31 06:10:04 +08:00
|
|
|
tracksRegLiveness: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1:
|
|
|
|
liveins: $x0
|
|
|
|
|
|
|
|
%0:_(p0) = COPY $x0
|
|
|
|
%1:_(s64) = G_INTTOPTR %0(p0)
|
|
|
|
$x0 = COPY %1(s64)
|
|
|
|
RET_ReallyLR implicit $x0
|
|
|
|
|
|
|
|
...
|