forked from OSchip/llvm-project
[NFC][PowerPC] Add a new case to test two-address verification
This commit is contained in:
parent
34e39eb2ad
commit
e6e89875b0
|
@ -0,0 +1,45 @@
|
|||
# RUN: not --crash llc -mtriple=ppc32-- %s -run-pass=phi-node-elimination \
|
||||
# RUN: -verify-machineinstrs -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
--- |
|
||||
define void @VerifyTwoAddressCrash(i16 %div.0.i.i.i.i, i32 %L_num.0.i.i.i.i, i32 %tmp1.i.i206.i.i, i16* %P) {
|
||||
%X = shl i16 %div.0.i.i.i.i, 1
|
||||
%tmp28.i.i.i.i = shl i32 %L_num.0.i.i.i.i, 1
|
||||
%tmp31.i.i.i.i = icmp slt i32 %tmp28.i.i.i.i, %tmp1.i.i206.i.i
|
||||
%tmp31.i.i.i.i.upgrd.1 = zext i1 %tmp31.i.i.i.i to i16
|
||||
%tmp371.i.i.i.i1 = or i16 %tmp31.i.i.i.i.upgrd.1, %X
|
||||
%div.0.be.i.i.i.i = xor i16 %tmp371.i.i.i.i1, 1
|
||||
store i16 %div.0.be.i.i.i.i, i16* %P, align 2
|
||||
ret void
|
||||
}
|
||||
|
||||
...
|
||||
---
|
||||
name: VerifyTwoAddressCrash
|
||||
body: |
|
||||
bb.0 (%ir-block.0):
|
||||
liveins: $r3, $r4, $r5, $r6
|
||||
|
||||
%3:gprc_and_gprc_nor0 = COPY killed $r6
|
||||
%2:gprc = COPY killed $r5
|
||||
%1:gprc = COPY killed $r4
|
||||
%0:gprc = COPY killed $r3
|
||||
%4:gprc = RLWINM killed %1, 1, 0, 30
|
||||
%5:crrc = CMPW killed %4, killed %2
|
||||
%6:crbitrc = COPY killed %5.sub_lt
|
||||
%7:gprc_and_gprc_nor0 = LI 0
|
||||
%8:gprc_and_gprc_nor0 = LI 1
|
||||
%9:gprc = ISEL killed %8, killed %7, killed %6
|
||||
%10:gprc = RLWIMI killed %9, killed %0, 1, 0, 30
|
||||
%11:gprc = XORI killed %10, 1
|
||||
STH killed %11, 0, killed %3 :: (store 2 into %ir.P)
|
||||
BLR implicit $lr, implicit $rm
|
||||
|
||||
...
|
||||
|
||||
# CHECK-LABEL: Bad machine code: Two-address instruction operands must be identical
|
||||
# CHECK-NEXT: - function: VerifyTwoAddressCrash
|
||||
# CHECK-NEXT: - basic block: %bb.0
|
||||
# CHECK-NEXT: - instruction: %10:gprc = RLWIMI killed %9:gprc(tied-def 0), killed %3:gprc, 1, 0, 30
|
||||
# CHECK-NEXT: - operand 1: killed %9:gprc(tied-def 0)
|
||||
# CHECK-NEXT: LLVM ERROR: Found 1 machine code errors.
|
Loading…
Reference in New Issue