Heejin Ahn fb6e024f49
[WebAssembly] Update generic and bleeding-edge CPUs (#96584)
This updates the list of features in 'generic' and 'bleeding-edge' CPUs
in the backend to match

4e0a0eae58/clang/lib/Basic/Targets/WebAssembly.cpp (L150-L178)

This updates existing CodeGen tests in a way that, if a test has
separate RUN lines for a reference-types test and a non-reference-types
test, I added -mattr=-reference-types to the no-reftype test's RUN
command line. I didn't delete existing -mattr=+reference-types lines in
reftype tests because having it helps readability.

Also, when tests is not really about reference-types but they have to
updated because they happen to contain call_indirect lines because now
call_indirect will take __indirect_function_table as an argument, I just
added the table argument to the expected output.

`target-features-cpus.ll` has been updated reflecting the newly added
features.
2024-07-01 19:12:01 -07:00

41 lines
1.6 KiB
LLVM

; RUN: llc < %s -asm-verbose=false -wasm-keep-registers | FileCheck %s --check-prefix=REG
; RUN: llc < %s -asm-verbose=false | FileCheck %s
target triple = "wasm32-unknown-unknown"
; Test direct and indirect function call between mismatched signatures
; CHECK-LABEL: foo:
; CHECK-NEXT: .functype foo (i32, i32, i32, i32) -> ()
define swiftcc void @foo(i32, i32) {
ret void
}
@data = global ptr @foo
; CHECK-LABEL: bar:
; CHECK-NEXT: .functype bar (i32, i32) -> ()
define swiftcc void @bar() {
%1 = load ptr, ptr @data
; REG: call foo, $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}
call swiftcc void @foo(i32 1, i32 2)
; REG: call_indirect $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}
; CHECK: call_indirect __indirect_function_table, (i32, i32, i32, i32) -> ()
call swiftcc void %1(i32 1, i32 2)
; REG: call_indirect $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}
; CHECK: call_indirect __indirect_function_table, (i32, i32, i32, i32) -> ()
call swiftcc void %1(i32 1, i32 2, i32 swiftself 3)
%err = alloca swifterror ptr, align 4
; REG: call_indirect $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}
; CHECK: call_indirect __indirect_function_table, (i32, i32, i32, i32) -> ()
call swiftcc void %1(i32 1, i32 2, ptr swifterror %err)
; REG: call_indirect $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}
; CHECK: call_indirect __indirect_function_table, (i32, i32, i32, i32) -> ()
call swiftcc void %1(i32 1, i32 2, i32 swiftself 3, ptr swifterror %err)
ret void
}