brintos

brintos / llvm-project-archived public Read only

0
0
Text · 994 B · 834e8c7 Raw
31 lines · plain
1;; RUN: opt -passes=rewrite-statepoints-for-gc,verify -S < %s | FileCheck %s2;; This test is to verify that RewriteStatepointsForGC correctly relocates values3;; defined by invoke instruction results.4 5declare ptr addrspace(1) @non_gc_call() "gc-leaf-function"6 7declare void @gc_call()8 9declare ptr @fake_personality_function()10 11define ptr addrspace(1) @test() gc "statepoint-example" personality ptr @fake_personality_function {12; CHECK-LABEL: @test(13 14entry:15  %obj = invoke ptr addrspace(1) @non_gc_call()16          to label %normal_dest unwind label %unwind_dest17 18unwind_dest:                                      ; preds = %entry19  %lpad = landingpad { ptr, i32 }20          cleanup21  resume { ptr, i32 } undef22 23normal_dest:                                      ; preds = %entry24; CHECK: normal_dest:25; CHECK-NEXT: gc.statepoint26; CHECK-NEXT: %obj.relocated = call coldcc ptr addrspace(1)27 28  call void @gc_call() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ]29  ret ptr addrspace(1) %obj30}31