Rewrite attr tests into .srctgt format
RENAME
tests/alive-tv/attrs/nocapture-fail.src.ll
tests/alive-tv/attrs/nocapture-fail.srctgt.ll
@x = global i8* null
-define void @f(i8* nocapture %p) {
+define void @src(i8* nocapture %p) {
%poison = getelementptr inbounds i8, i8* null, i32 1
store i8* %poison, i8** @x
ret void
}
+
+define void @tgt(i8* nocapture %p) {
+ store i8* %p, i8** @x
+ ret void
+}

DELETE
tests/alive-tv/attrs/nocapture-fail.tgt.ll
-@x = global i8* null
-
-define void @f(i8* nocapture %p) {
- store i8* %p, i8** @x
- ret void
-}

DELETE
tests/alive-tv/attrs/nocapture-icmp.src.ll
-define i1 @f(i8* nocapture %p, i8* %q) {
- %c = icmp eq i8* %p, %q
- ret i1 %c
-}
-; ERROR: Value mismatch

ADD
tests/alive-tv/attrs/nocapture-icmp.srctgt.ll
+define i1 @src(i8* nocapture %p, i8* %q) {
+ %c = icmp eq i8* %p, %q
+ ret i1 %c
+}
+define i1 @tgt(i8* nocapture %p, i8* %q) {
+ ret i1 false
+}
+; ERROR: Value mismatch

DELETE
tests/alive-tv/attrs/nocapture-icmp.tgt.ll
-define i1 @f(i8* nocapture %p, i8* %q) {
- ret i1 false
-}

RENAME
tests/alive-tv/attrs/nocapture-noundef.src.ll
tests/alive-tv/attrs/nocapture-noundef.srctgt.ll
; this is needed for correctness, since the cmn+branch needs to be strong
; TEST-ARGS: -disable-undef-input
-define i8* @f(i8* %a, i8* nocapture %b) {
+define i8* @src(i8* %a, i8* nocapture %b) {
%cmp = icmp eq i8* %a, %b
br i1 %cmp, label %t, label %f
@@ -13,4 +13,17 @@ f:
ret i8* null
}
+define i8* @tgt(i8* %a, i8* nocapture %b) {
+ %cmp = icmp eq i8* %a, %b
+ br i1 %cmp, label %t, label %f
+
+t:
+ %v = call i8* @g(i8* %a)
+ ret i8* %v
+
+f:
+ ret i8* null
+}
+
+
declare i8* @g(i8*)

DELETE
tests/alive-tv/attrs/nocapture-noundef.tgt.ll
-define i8* @f(i8* %a, i8* nocapture %b) {
- %cmp = icmp eq i8* %a, %b
- br i1 %cmp, label %t, label %f
-
-t:
- %v = call i8* @g(i8* %a)
- ret i8* %v
-
-f:
- ret i8* null
-}
-
-declare i8* @g(i8*)

DELETE
tests/alive-tv/attrs/nocapture-replace.src.ll
-define i8* @f6(i8* nocapture %p, i8* %q) {
- %c = icmp eq i8* %p, %q
- br i1 %c, label %A, label %B
-A:
- ret i8* %q
-B:
- ret i8* null
-}
-
-; ERROR: Source is more defined than target

ADD
tests/alive-tv/attrs/nocapture-replace.srctgt.ll
+define i8* @src(i8* nocapture %p, i8* %q) {
+ %c = icmp eq i8* %p, %q
+ br i1 %c, label %A, label %B
+A:
+ ret i8* %q
+B:
+ ret i8* null
+}
+define i8* @tgt(i8* nocapture %p, i8* %q) {
+ %c = icmp eq i8* %p, %q
+ br i1 %c, label %A, label %B
+A:
+ ret i8* %p
+B:
+ ret i8* null
+}
+
+; ERROR: Source is more defined than target

DELETE
tests/alive-tv/attrs/nocapture-replace.tgt.ll
-define i8* @f6(i8* nocapture %p, i8* %q) {
- %c = icmp eq i8* %p, %q
- br i1 %c, label %A, label %B
-A:
- ret i8* %p
-B:
- ret i8* null
-}

RENAME
tests/alive-tv/attrs/readnone-fail.src.ll
tests/alive-tv/attrs/readnone-fail.srctgt.ll
; argument, even though it may read or write the memory that the pointer points
; to if accessed through other pointers.
; """
-define i8 @f(i8* readnone %x, i8* %y) {
+define i8 @src(i8* readnone %x, i8* %y) {
%c = icmp eq i8* %x, %y
br i1 %c, label %A, label %EXIT
A:
@@ -14,4 +14,8 @@ EXIT:
ret i8 0
}
+define i8 @tgt(i8* readnone %x, i8* %y) {
+ ret i8 0
+}
+
; ERROR: Value mismatch

DELETE
tests/alive-tv/attrs/readnone-fail.tgt.ll
-define i8 @f(i8* readnone %x, i8* %y) {
- ret i8 0
-}

Rewrite attr tests into .srctgt format (#364)