1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mattr=+simd128 | FileCheck %s
4 ; Regression test for a crash caused by
5 ; WebAssemblyTargetLowering::ReplaceNodeResults not being
6 ; implemented. Since SIMD is enabled, sign_ext_inreg is custom lowered
7 ; but the result is i16, an illegal value. This requires
8 ; ReplaceNodeResults to resolve, but the default implementation is to
11 target triple = "wasm32-unknown-emscripten"
15 ; CHECK: .functype foo () -> ()
16 ; CHECK-NEXT: .local i32
17 ; CHECK-NEXT: # %bb.0: # %entry
18 ; CHECK-NEXT: i32.const 0
19 ; CHECK-NEXT: local.get 0
20 ; CHECK-NEXT: i32.load8_s 0
21 ; CHECK-NEXT: i32.store16 0
22 ; CHECK-NEXT: # fallthrough-return
24 %0 = load ptr, ptr undef, align 4
25 %1 = load i32, ptr %0, align 4
26 %2 = load i32, ptr undef, align 4
27 %conv67 = trunc i32 %2 to i8
28 %conv68 = sext i8 %conv67 to i16
29 store i16 %conv68, ptr null, align 2