1 ; RUN: llc < %s -march=nvptx64 2>&1 | FileCheck %s
2 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 | %ptxas-verify %}
4 ; Allow to make libcalls that are defined in the current module
6 declare ptr @malloc(i64)
7 declare void @free(ptr)
9 ; Underlying libcall declaration
10 ; CHECK: .visible .func (.param .align 16 .b8 func_retval0[16]) __umodti3
12 define i128 @remainder(i128, i128) {
14 ; CHECK: { // callseq 0, 0
15 ; CHECK: call.uni (retval0),
16 ; CHECK-NEXT: __umodti3,
21 ; CHECK-NEXT: ld.param.v2.b64 {%[[REG0:rd[0-9]+]], %[[REG1:rd[0-9]+]]}, [retval0+0];
22 ; CHECK-NEXT: } // callseq 0
27 ; CHECK-NEXT: st.param.v2.b64 [func_retval0+0], {%[[REG0]], %[[REG1]]};
32 ; Underlying libcall definition
33 ; CHECK: .visible .func (.param .align 16 .b8 func_retval0[16]) __umodti3(
34 define i128 @__umodti3(i128, i128) {
38 define void @malloc_then_free() {
39 ; CHECK: call.uni (retval0),
43 %a = call ptr @malloc(i64 4)
45 call void @free(ptr %a)