1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
2 ; RUN: opt -passes=function-attrs -S < %s | FileCheck --check-prefixes=COMMON,FNATTRS %s
3 ; RUN: opt -passes=attributor-light -S < %s | FileCheck --check-prefixes=COMMON,ATTRIBUTOR %s
5 define void @bar(ptr readonly %0) {
6 ; FNATTRS-LABEL: define void @bar(
7 ; FNATTRS-SAME: ptr nocapture readnone [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
8 ; FNATTRS-NEXT: call void @foo(ptr [[TMP0]])
9 ; FNATTRS-NEXT: ret void
11 ; ATTRIBUTOR-LABEL: define void @bar(
12 ; ATTRIBUTOR-SAME: ptr nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
13 ; ATTRIBUTOR-NEXT: call void @foo(ptr nocapture nofree readnone [[TMP0]]) #[[ATTR0]]
14 ; ATTRIBUTOR-NEXT: ret void
16 call void @foo(ptr %0)
20 define void @foo(ptr readonly %0) {
21 ; FNATTRS-LABEL: define void @foo(
22 ; FNATTRS-SAME: ptr nocapture readnone [[TMP0:%.*]]) #[[ATTR0]] {
23 ; FNATTRS-NEXT: call void @bar(ptr [[TMP0]])
24 ; FNATTRS-NEXT: ret void
26 ; ATTRIBUTOR-LABEL: define void @foo(
27 ; ATTRIBUTOR-SAME: ptr nocapture nofree readnone [[TMP0:%.*]]) #[[ATTR0]] {
28 ; ATTRIBUTOR-NEXT: call void @bar(ptr nocapture nofree readnone [[TMP0]]) #[[ATTR0]]
29 ; ATTRIBUTOR-NEXT: ret void
31 call void @bar(ptr %0)
34 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: