1 # RUN: llc -mtriple=wasm32-unknown-unknown -exception-model=wasm -mattr=+exception-handling,+multivalue,+simd128 -run-pass wasm-cfg-sort -run-pass wasm-cfg-stackify %s -o - | FileCheck %s
4 target triple = "wasm32-unknown-unknown"
6 declare i32 @__gxx_wasm_personality_v0(...)
8 define void @function_property_test() {
11 define void @wasm_eh_info_test() personality i8* bitcast (i32 (...)* @__gxx_wasm_personality_v0 to i8*) {
15 ;; Param / results tests
16 define i32 @i32__i64(i64) {
19 define void @void__i32_i64_f32_f64() {
22 define void @void__v16i8_v8i16_v4i32_v2i64(<16 x i8>, <8 x i16>, <4 x i32>, <2 x i64>) {
25 %pair = type { i32, i64 }
26 define %pair @i32_i64__i32_i64(%pair %p) {
31 # CHECK-LABEL: name: function_property_test
32 # CHECK: machineFunctionInfo:
33 # CHECK: isCFGStackified: true
34 name: function_property_test
36 - { reg: '$arguments' }
39 RETURN implicit-def dead $arguments
43 # CHECK-LABEL: name: wasm_eh_info_test
44 # CHECK: machineFunctionInfo:
45 name: wasm_eh_info_test
47 - { reg: '$arguments' }
48 # CHECK: wasmEHFuncInfo:
49 # bb.2 becomes bb.1 and bb.3 becomes bb.2 after CFGSort.
56 successors: %bb.1, %bb.2
57 CALL @foo, implicit-def dead $arguments, implicit $sp32, implicit $sp64, implicit-def dead $arguments, implicit $sp32, implicit $sp64
60 RETURN implicit-def dead $arguments
63 successors: %bb.1, %bb.3
64 %0:i32 = CATCH &__cpp_exception, implicit-def dead $arguments
65 CALL @foo, implicit-def dead $arguments, implicit $sp32, implicit $sp64, implicit-def dead $arguments, implicit $sp32, implicit $sp64
66 BR %bb.1, implicit-def $arguments
69 CATCH_ALL implicit-def $arguments
70 RETHROW 0, implicit-def $arguments
73 # Param / results tests
75 # CHECK-LABEL: name: i32__i64
76 # CHECK: machineFunctionInfo:
77 # CHECK: params: [ i64 ]
78 # CHECK-NEXT: results: [ i32 ]
81 - { reg: '$arguments' }
87 %0:i32 = CONST_I32 3, implicit-def dead $arguments
88 RETURN %0:i32, implicit-def dead $arguments
91 # CHECK-LABEL: name: void__i32_i64_f32_f64
92 # CHECK: machineFunctionInfo:
93 # CHECK: params: [ i32, i64, f32, f64 ]
94 # CHECK-NEXT: results: [ ]
95 name: void__i32_i64_f32_f64
97 - { reg: '$arguments' }
99 params: [ i32, i64, f32, f64 ]
103 RETURN implicit-def dead $arguments
106 # CHECK-LABEL: name: void__v16i8_v8i16_v4i32_v2i64
107 # CHECK: machineFunctionInfo:
108 # CHECK: params: [ v16i8, v8i16, v4i32, v2i64 ]
109 # CHECK-NEXT: results: [ ]
110 name: void__v16i8_v8i16_v4i32_v2i64
112 - { reg: '$arguments' }
114 params: [ v16i8, v8i16, v4i32, v2i64 ]
118 RETURN implicit-def dead $arguments
121 # CHECK-LABEL: name: i32_i64__i32_i64
122 # CHECK: machineFunctionInfo:
123 # CHECK: params: [ i32, i64 ]
124 # CHECK-NEXT: results: [ i32, i64 ]
125 name: i32_i64__i32_i64
127 - { reg: '$arguments' }
130 results: [ i32, i64 ]
133 %0:i32 = ARGUMENT_i32 0, implicit $arguments
134 %1:i64 = ARGUMENT_i64 1, implicit $arguments
135 RETURN %0, %1, implicit-def dead $arguments