1; RUN: llc < %s -mattr=+simd128 | FileCheck %s
2
3; Regression test for a crash caused by
4; WebAssemblyTargetLowering::ReplaceNodeResults not being
5; implemented. Since SIMD is enabled, sign_ext_inreg is custom lowered
6; but the result is i16, an illegal value. This requires
7; ReplaceNodeResults to resolve, but the default implementation is to
8; abort.
9
10target triple = "wasm32-unknown-emscripten"
11
12; CHECK: i32.load8_s
13; CHECK-NEXT: i32.store16
14define void @foo() {
15entry:
16  %0 = load i32*, i32** undef, align 4
17  %1 = load i32, i32* %0, align 4
18  %2 = load i32, i32* undef, align 4
19  %conv67 = trunc i32 %2 to i8
20  %conv68 = sext i8 %conv67 to i16
21  store i16 %conv68, i16* null, align 2
22  ret void
23}
24