|
| 1 | +# RUN: llc -mtriple=wasm32-unknown-unknown -run-pass wasm-reg-stackify -verify-machineinstrs %s -o - |
| 2 | + |
| 3 | +# TEE generation in RegStackify can create virtual registers with LiveIntervals |
| 4 | +# with multiple disconnected segments, which is invalid in MachineVerifier. In |
| 5 | +# this test, '%0 = CALL @foo' will become a CALL and a TEE, which creates |
| 6 | +# unconnected split segments. This should be later split into multiple |
| 7 | +# registers. This test should not crash with -verify-machineinstrs, which checks |
| 8 | +# whether all segments within a register is connected. See ??? for the detailed |
| 9 | +# explanation. |
| 10 | + |
| 11 | +--- | |
| 12 | + target triple = "wasm32-unknown-unknown" |
| 13 | + |
| 14 | + declare ptr @foo(ptr returned) |
| 15 | + define void @tee_live_intervals_test() { |
| 16 | + ret void |
| 17 | + } |
| 18 | +... |
| 19 | +--- |
| 20 | +name: tee_live_intervals_test |
| 21 | +liveins: |
| 22 | + - { reg: '$arguments' } |
| 23 | +tracksRegLiveness: true |
| 24 | +body: | |
| 25 | + bb.0: |
| 26 | + liveins: $arguments |
| 27 | + successors: %bb.1, %bb.2 |
| 28 | + %0:i32 = ARGUMENT_i32 0, implicit $arguments |
| 29 | + %1:i32 = CONST_I32 0, implicit-def dead $arguments |
| 30 | + BR_IF %bb.2, %1:i32, implicit-def dead $arguments |
| 31 | +
|
| 32 | + bb.1: |
| 33 | + ; predecessors: %bb.0 |
| 34 | + %0:i32 = CALL @foo, %0:i32, implicit-def dead $arguments, implicit $sp32, implicit $sp64 |
| 35 | + STORE8_I32_A32 0, 0, %0:i32, %1:i32, implicit-def dead $arguments |
| 36 | + RETURN %0:i32, implicit-def dead $arguments |
| 37 | +
|
| 38 | + bb.2: |
| 39 | + ; predecessors: %bb.0 |
| 40 | + %2:i32 = CONST_I32 0, implicit-def dead $arguments |
| 41 | + RETURN %2:i32, implicit-def dead $arguments |
0 commit comments