70 lines · plain
1; RUN: opt < %s -passes=tailcallelim -verify-dom-info -S | FileCheck %s2 3define i32 @f_1(i32 %x) {4; CHECK-LABEL: @f_1(5wentry:6 %cond = icmp ugt i32 %x, 07 br i1 %cond, label %return, label %body8 9body:10; CHECK: body:11; CHECK: call i32 @f_1(i32 %y) [ "deopt"() ]12 %y = add i32 %x, 113 %tmp = call i32 @f_1(i32 %y) [ "deopt"() ]14 ret i32 015 16return:17 ret i32 118}19 20define i32 @f_2(i32 %x) {21; CHECK-LABEL: @f_222 23entry:24 %cond = icmp ugt i32 %x, 025 br i1 %cond, label %return, label %body26 27body:28; CHECK: body:29; CHECK: call i32 @f_2(i32 %y) [ "unknown"() ]30 %y = add i32 %x, 131 %tmp = call i32 @f_2(i32 %y) [ "unknown"() ]32 ret i32 033 34return:35 ret i32 136}37 38declare void @func()39 40define void @f_3(i1 %B) personality i8 42 {41; CHECK-LABEL: @f_3(42entry:43 invoke void @func()44 to label %exit unwind label %merge45merge:46 %cs1 = catchswitch within none [label %catch] unwind to caller47 48catch:49; CHECK: catch:50; CHECK: call void @f_3(i1 %B) [ "funclet"(token %cp) ]51 %cp = catchpad within %cs1 []52 call void @f_3(i1 %B) [ "funclet"(token %cp) ]53 ret void54 55exit:56 ret void57}58 59; CHECK-LABEL: @test_clang_arc_attachedcall(60; CHECK: tail call ptr @getObj(61 62declare ptr @getObj()63 64define ptr @test_clang_arc_attachedcall() {65 %r = call ptr @getObj() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]66 ret ptr %r67}68 69declare ptr @llvm.objc.retainAutoreleasedReturnValue(ptr)70