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 datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
11target triple = "wasm32-unknown-emscripten"
12
13; CHECK: i32.load8_s
14; CHECK-NEXT: i32.store16
15define void @foo() {
16entry:
17  %0 = load i32*, i32** undef, align 4
18  %1 = load i32, i32* %0, align 4
19  %2 = load i32, i32* undef, align 4
20  %conv67 = trunc i32 %2 to i8
21  %conv68 = sext i8 %conv67 to i16
22  store i16 %conv68, i16* null, align 2
23  ret void
24}
25