26 lines · plain
1// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s2 3// CHECK-LABEL: @test4llvm.func @test(%arg0: i16 {llvm.noundef, llvm.signext}) -> (i16 {llvm.signext}) attributes {personality = @__gxx_personality_v0} {5 %0 = llvm.mlir.zero : !llvm.ptr6 %1 = llvm.mlir.constant(0 : i16) : i167 // CHECK: invoke signext i16 @somefunc(i16 noundef signext %{{.*}})8 // CHECK-NEXT: to label %{{.*}} unwind label %{{.*}}9 %2 = llvm.invoke @somefunc(%arg0) to ^bb2 unwind ^bb1 : (i16 {llvm.noundef, llvm.signext}) -> (i16 {llvm.signext})10^bb1: // pred: ^bb011 %3 = llvm.landingpad (catch %0 : !llvm.ptr) : !llvm.struct<(ptr, i32)>12 %4 = llvm.extractvalue %3[0] : !llvm.struct<(ptr, i32)>13 %5 = llvm.call tail @__cxa_begin_catch(%4) : (!llvm.ptr) -> !llvm.ptr14 llvm.call tail @__cxa_end_catch() : () -> ()15 llvm.br ^bb3(%1 : i16)16^bb2: // pred: ^bb017 llvm.br ^bb3(%2 : i16)18^bb3(%6: i16): // 2 preds: ^bb1, ^bb219 llvm.return %6 : i1620}21 22llvm.func @somefunc(i16 {llvm.noundef, llvm.signext}) -> (i16 {llvm.noundef, llvm.signext})23llvm.func @__gxx_personality_v0(...) -> i3224llvm.func @__cxa_begin_catch(!llvm.ptr) -> !llvm.ptr25llvm.func @__cxa_end_catch()26