Remove conflicting attributes before adding deduced readonly/readnone
[oota-llvm.git] / test / Transforms / FunctionAttrs / readnone.ll
diff --git a/test/Transforms/FunctionAttrs/readnone.ll b/test/Transforms/FunctionAttrs/readnone.ll
new file mode 100644 (file)
index 0000000..eddcdd2
--- /dev/null
@@ -0,0 +1,13 @@
+; 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
+}