[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / test / Transforms / RewriteStatepointsForGC / relocate-invoke-result.ll
blob834e8c705af3ce74a384f0833871f22d677b6c00
1 ;; RUN: opt -passes=rewrite-statepoints-for-gc,verify -S < %s | FileCheck %s
2 ;; This test is to verify that RewriteStatepointsForGC correctly relocates values
3 ;; defined by invoke instruction results.
5 declare ptr addrspace(1) @non_gc_call() "gc-leaf-function"
7 declare void @gc_call()
9 declare ptr @fake_personality_function()
11 define ptr addrspace(1) @test() gc "statepoint-example" personality ptr @fake_personality_function {
12 ; CHECK-LABEL: @test(
14 entry:
15   %obj = invoke ptr addrspace(1) @non_gc_call()
16           to label %normal_dest unwind label %unwind_dest
18 unwind_dest:                                      ; preds = %entry
19   %lpad = landingpad { ptr, i32 }
20           cleanup
21   resume { ptr, i32 } undef
23 normal_dest:                                      ; preds = %entry
24 ; CHECK: normal_dest:
25 ; CHECK-NEXT: gc.statepoint
26 ; CHECK-NEXT: %obj.relocated = call coldcc ptr addrspace(1)
28   call void @gc_call() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ]
29   ret ptr addrspace(1) %obj