1 ; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
4 ; Ensure we're stipping attributes from the function signatures which are invalid
5 ; after inserting safepoints with explicit memory semantics
9 define ptr addrspace(1) @deref_arg(ptr addrspace(1) dereferenceable(16) %arg) gc "statepoint-example" {
10 ; CHECK: define ptr addrspace(1) @deref_arg(ptr addrspace(1) %arg)
12 ret ptr addrspace(1) %arg
15 define dereferenceable(16) ptr addrspace(1) @deref_ret(ptr addrspace(1) %arg) gc "statepoint-example" {
16 ; CHECK: define ptr addrspace(1) @deref_ret(ptr addrspace(1) %arg)
18 ret ptr addrspace(1) %arg
21 define ptr addrspace(1) @deref_or_null_arg(ptr addrspace(1) dereferenceable_or_null(16) %arg) gc "statepoint-example" {
22 ; CHECK: define ptr addrspace(1) @deref_or_null_arg(ptr addrspace(1) %arg)
24 ret ptr addrspace(1) %arg
27 define dereferenceable_or_null(16) ptr addrspace(1) @deref_or_null_ret(ptr addrspace(1) %arg) gc "statepoint-example" {
28 ; CHECK: define ptr addrspace(1) @deref_or_null_ret(ptr addrspace(1) %arg)
30 ret ptr addrspace(1) %arg
33 define ptr addrspace(1) @noalias_arg(ptr addrspace(1) noalias %arg) gc "statepoint-example" {
34 ; CHECK: define ptr addrspace(1) @noalias_arg(ptr addrspace(1) %arg)
36 ret ptr addrspace(1) %arg
39 define noalias ptr addrspace(1) @noalias_ret(ptr addrspace(1) %arg) gc "statepoint-example" {
40 ; CHECK: define ptr addrspace(1) @noalias_ret(ptr addrspace(1) %arg)
42 ret ptr addrspace(1) %arg
45 define ptr addrspace(1) @nofree(ptr addrspace(1) nofree %arg) nofree gc "statepoint-example" {
46 ; CHECK: define ptr addrspace(1) @nofree(ptr addrspace(1) %arg) gc "statepoint-example" {
48 ret ptr addrspace(1) %arg
51 define ptr addrspace(1) @nosync(ptr addrspace(1) %arg) nosync gc "statepoint-example" {
52 ; CHECK: define ptr addrspace(1) @nosync(ptr addrspace(1) %arg) gc "statepoint-example" {
54 ret ptr addrspace(1) %arg
57 define ptr addrspace(1) @readnone(ptr addrspace(1) readnone %arg) readnone gc "statepoint-example" {
58 ; CHECK: define ptr addrspace(1) @readnone(ptr addrspace(1) %arg) gc "statepoint-example" {
60 ret ptr addrspace(1) %arg
63 define ptr addrspace(1) @readonly(ptr addrspace(1) readonly %arg) readonly gc "statepoint-example" {
64 ; CHECK: define ptr addrspace(1) @readonly(ptr addrspace(1) %arg) gc "statepoint-example" {
66 ret ptr addrspace(1) %arg
69 define ptr addrspace(1) @writeonly(ptr addrspace(1) writeonly %arg) writeonly gc "statepoint-example" {
70 ; CHECK: define ptr addrspace(1) @writeonly(ptr addrspace(1) %arg) gc "statepoint-example" {
72 ret ptr addrspace(1) %arg
75 define ptr addrspace(1) @argmemonly(ptr addrspace(1) %arg) argmemonly gc "statepoint-example" {
76 ; CHECK: define ptr addrspace(1) @argmemonly(ptr addrspace(1) %arg) gc "statepoint-example" {
78 ret ptr addrspace(1) %arg
81 define ptr addrspace(1) @inaccessiblememonly(ptr addrspace(1) %arg) inaccessiblememonly gc "statepoint-example" {
82 ; CHECK: define ptr addrspace(1) @inaccessiblememonly(ptr addrspace(1) %arg) gc "statepoint-example" {
84 ret ptr addrspace(1) %arg
87 define ptr addrspace(1) @inaccessiblemem_or_argmemonly(ptr addrspace(1) %arg) inaccessiblemem_or_argmemonly gc "statepoint-example" {
88 ; CHECK: define ptr addrspace(1) @inaccessiblemem_or_argmemonly(ptr addrspace(1) %arg) gc "statepoint-example" {
90 ret ptr addrspace(1) %arg