1 ; RUN: llc -mtriple=wasm32 -verify-machineinstrs < %s | FileCheck %s
3 ; Demonstrates that appropriate .functype directives are emitted for defined
4 ; functions, declared functions, and any libcalls.
6 ; CHECK: .functype __multi3 (i32, i64, i64, i64, i64) -> ()
7 ; CHECK: .functype __unordtf2 (i64, i64, i64, i64) -> (i32)
8 ; CHECK: .functype defined_fun_1 (f64) -> (i64)
9 ; CHECK: .functype defined_fun_2 (f64, i32) -> (i64)
10 ; CHECK: .functype declared_fun (i32, f32, i64) -> (i32)
12 define i64 @defined_fun_1(double %a) {
13 ; CHECK-LABEL: defined_fun_1:
14 ; CHECK: .functype defined_fun_1 (f64) -> (i64)
15 %1 = call i64 @defined_fun_2(double %a, i32 1)
19 define i64 @defined_fun_2(double %a, i32 %b) {
20 ; CHECK-LABEL: defined_fun_2:
21 ; CHECK: .functype defined_fun_2 (f64, i32) -> (i64)
22 %1 = call i64 @defined_fun_1(double %a)
26 declare i8 @declared_fun(i32, float, i64)
28 define i128 @libcalls(fp128 %a, fp128 %b, i128 %c, i128 %d) {
29 ; CHECK-LABEL: libcalls:
30 ; CHECK: .functype libcalls (i32, i64, i64, i64, i64, i64, i64, i64, i64) -> ()
31 %1 = fcmp uno fp128 %a, %b
32 %2 = zext i1 %1 to i128