xref: /llvm-project/llvm/test/CodeGen/AMDGPU/trunc-vector-store-assertion-failure.ll (revision 2cbfe4a823020b2efe53d32ad7eccbc5a037943f)
1; RUN: llc < %s -mtriple=r600-- -mcpu=redwood | FileCheck %s
2
3; This tests for a bug in the SelectionDAG where custom lowered truncated
4; vector stores at the end of a basic block were not being added to the
5; LegalizedNodes list, which triggered an assertion failure.
6
7; CHECK-LABEL: {{^}}test:
8; CHECK: MEM_RAT_CACHELESS STORE_RAW
9define amdgpu_kernel void @test(ptr addrspace(1) %out, i32 %cond, <4 x i8> %in) {
10entry:
11  %0 = icmp eq i32 %cond, 0
12  br i1 %0, label %if, label %done
13
14if:
15  store <4 x i8> %in, ptr addrspace(1) %out
16  br label %done
17
18done:
19  ret void
20}
21