1 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
2 ; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
5 ; Ensure we're stipping attributes from the function signatures which are invalid
6 ; after inserting safepoints with explicit memory semantics
10 define i8 addrspace(1)* @deref_arg(i8 addrspace(1)* dereferenceable(16) %arg) gc "statepoint-example" {
11 ; CHECK: define i8 addrspace(1)* @deref_arg(i8 addrspace(1)* %arg)
13 ret i8 addrspace(1)* %arg
16 define dereferenceable(16) i8 addrspace(1)* @deref_ret(i8 addrspace(1)* %arg) gc "statepoint-example" {
17 ; CHECK: define i8 addrspace(1)* @deref_ret(i8 addrspace(1)* %arg)
19 ret i8 addrspace(1)* %arg
22 define i8 addrspace(1)* @deref_or_null_arg(i8 addrspace(1)* dereferenceable_or_null(16) %arg) gc "statepoint-example" {
23 ; CHECK: define i8 addrspace(1)* @deref_or_null_arg(i8 addrspace(1)* %arg)
25 ret i8 addrspace(1)* %arg
28 define dereferenceable_or_null(16) i8 addrspace(1)* @deref_or_null_ret(i8 addrspace(1)* %arg) gc "statepoint-example" {
29 ; CHECK: define i8 addrspace(1)* @deref_or_null_ret(i8 addrspace(1)* %arg)
31 ret i8 addrspace(1)* %arg
34 define i8 addrspace(1)* @noalias_arg(i8 addrspace(1)* noalias %arg) gc "statepoint-example" {
35 ; CHECK: define i8 addrspace(1)* @noalias_arg(i8 addrspace(1)* %arg)
37 ret i8 addrspace(1)* %arg
40 define noalias i8 addrspace(1)* @noalias_ret(i8 addrspace(1)* %arg) gc "statepoint-example" {
41 ; CHECK: define i8 addrspace(1)* @noalias_ret(i8 addrspace(1)* %arg)
43 ret i8 addrspace(1)* %arg
46 define i8 addrspace(1)* @nofree(i8 addrspace(1)* nofree %arg) nofree gc "statepoint-example" {
47 ; CHECK: define i8 addrspace(1)* @nofree(i8 addrspace(1)* %arg) gc "statepoint-example" {
49 ret i8 addrspace(1)* %arg
52 define i8 addrspace(1)* @nosync(i8 addrspace(1)* %arg) nosync gc "statepoint-example" {
53 ; CHECK: define i8 addrspace(1)* @nosync(i8 addrspace(1)* %arg) gc "statepoint-example" {
55 ret i8 addrspace(1)* %arg
58 define i8 addrspace(1)* @readnone(i8 addrspace(1)* readnone %arg) readnone gc "statepoint-example" {
59 ; CHECK: define i8 addrspace(1)* @readnone(i8 addrspace(1)* %arg) gc "statepoint-example" {
61 ret i8 addrspace(1)* %arg
64 define i8 addrspace(1)* @readonly(i8 addrspace(1)* readonly %arg) readonly gc "statepoint-example" {
65 ; CHECK: define i8 addrspace(1)* @readonly(i8 addrspace(1)* %arg) gc "statepoint-example" {
67 ret i8 addrspace(1)* %arg
70 define i8 addrspace(1)* @writeonly(i8 addrspace(1)* writeonly %arg) writeonly gc "statepoint-example" {
71 ; CHECK: define i8 addrspace(1)* @writeonly(i8 addrspace(1)* %arg) gc "statepoint-example" {
73 ret i8 addrspace(1)* %arg
76 define i8 addrspace(1)* @argmemonly(i8 addrspace(1)* %arg) argmemonly gc "statepoint-example" {
77 ; CHECK: define i8 addrspace(1)* @argmemonly(i8 addrspace(1)* %arg) gc "statepoint-example" {
79 ret i8 addrspace(1)* %arg
82 define i8 addrspace(1)* @inaccessiblememonly(i8 addrspace(1)* %arg) inaccessiblememonly gc "statepoint-example" {
83 ; CHECK: define i8 addrspace(1)* @inaccessiblememonly(i8 addrspace(1)* %arg) gc "statepoint-example" {
85 ret i8 addrspace(1)* %arg
88 define i8 addrspace(1)* @inaccessiblemem_or_argmemonly(i8 addrspace(1)* %arg) inaccessiblemem_or_argmemonly gc "statepoint-example" {
89 ; CHECK: define i8 addrspace(1)* @inaccessiblemem_or_argmemonly(i8 addrspace(1)* %arg) gc "statepoint-example" {
91 ret i8 addrspace(1)* %arg