42 lines · plain
1; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s2 3; CHECK-LABEL: llvm.func @somefunc(i32, !llvm.ptr)4declare void @somefunc(i32, ptr)5 6; CHECK-LABEL: llvm.func @test_call_arg_attrs_direct(7; CHECK-SAME: %[[VAL_0:.*]]: i32,8; CHECK-SAME: %[[VAL_1:.*]]: !llvm.ptr)9define void @test_call_arg_attrs_direct(i32 %0, ptr %1) {10 ; CHECK: llvm.call @somefunc(%[[VAL_0]], %[[VAL_1]]) : (i32, !llvm.ptr {llvm.byval = i64}) -> ()11 call void @somefunc(i32 %0, ptr byval(i64) %1)12 ret void13}14 15; CHECK-LABEL: llvm.func @test_call_arg_attrs_indirect(16; CHECK-SAME: %[[VAL_0:.*]]: i16,17; CHECK-SAME: %[[VAL_1:.*]]: !llvm.ptr18define i16 @test_call_arg_attrs_indirect(i16 %0, ptr %1) {19 ; CHECK: llvm.call tail %[[VAL_1]](%[[VAL_0]]) : !llvm.ptr, (i16 {llvm.noundef, llvm.signext}) -> (i16 {llvm.signext})20 %3 = tail call signext i16 %1(i16 noundef signext %0)21 ret i16 %322}23 24; // -----25 26%struct.S = type { i8 }27 28; CHECK-LABEL: @t29define void @t(i1 %0) #0 {30 %3 = alloca %struct.S, align 131 ; CHECK-NOT: llvm.call @z(%1) {no_unwind} : (!llvm.ptr) -> ()32 ; CHECK: llvm.call @z(%1) : (!llvm.ptr) -> ()33 call void @z(ptr %3)34 ret void35}36 37define linkonce_odr void @z(ptr %0) #0 {38 ret void39}40 41attributes #0 = { nounwind }42