1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/Transforms/FunctionAttrs/readnone.ll
Bjorn Steinbrink 8603eb4818 Remove conflicting attributes before adding deduced readonly/readnone
Summary:
In case of functions that have a pointer argument and only pass it to
each other, the function attributes pass deduces that the pointer should
get the readnone attribute, but fails to remove a readonly attribute
that may already have been present.

Reviewers: nlewycky

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9995

llvm-svn: 238152
2015-05-25 19:46:38 +00:00

14 lines
295 B
LLVM

; RUN: opt < %s -functionattrs -S | FileCheck %s
; CHECK: define void @bar(i8* nocapture readnone)
define void @bar(i8* readonly) {
call void @foo(i8* %0)
ret void
}
; CHECK: define void @foo(i8* nocapture readnone)
define void @foo(i8* readonly) {
call void @bar(i8* %0)
ret void
}