1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
2 ; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
3 ; Ensure statepoints copy (valid) attributes from callsites.
5 declare void @f(ptr addrspace(1) %obj)
7 ; copy over norecurse noimplicitfloat to statepoint call
8 define void @test1(ptr addrspace(1) %arg) gc "statepoint-example" {
10 ; CHECK-NEXT: [[STATEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void (ptr addrspace(1))) @f, i32 1, i32 0, ptr addrspace(1) [[ARG:%.*]], i32 0, i32 0) #[[ATTR1:[0-9]+]] [ "gc-live"(ptr addrspace(1) [[ARG]]) ]
11 ; CHECK-NEXT: [[ARG_RELOCATED:%.*]] = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[STATEPOINT_TOKEN]], i32 0, i32 0)
12 ; CHECK-NEXT: ret void
15 call void @f(ptr addrspace(1) %arg) #1
20 attributes #1 = { norecurse noimplicitfloat }
22 ; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(none) }
23 ; CHECK: attributes #[[ATTR1]] = { noimplicitfloat norecurse }