test: add inf-loop-unrolled/local-unescaped version of LLVM bugzilla reports
ADD
tests/alive-tv/bugs/pr10067-nolocal.srctgt.ll
+%struct1 = type { i32, i32 }
+%struct2 = type { %struct1, i8* }
+
+define i32 @src(%struct1 %init_val) {
+ %x = alloca %struct1, align 8
+ %y = alloca %struct2, align 8
+ store %struct1 %init_val, %struct1* %x
+
+ %gepn1 = getelementptr inbounds %struct2, %struct2* %y, i32 0, i32 0, i32 0
+ store i32 0, i32* %gepn1, align 8
+ %gepn2 = getelementptr inbounds %struct2, %struct2* %y, i32 0, i32 0, i32 1
+ store i32 0, i32* %gepn2, align 4
+
+ %bit1 = bitcast %struct1* %x to i64*
+ %bit2 = bitcast %struct2* %y to i64*
+ %load = load i64, i64* %bit1, align 8
+ store i64 %load, i64* %bit2, align 8
+
+ %gep1 = getelementptr %struct2, %struct2* %y, i32 0, i32 0, i32 0
+ %ret = load i32, i32* %gep1
+ ret i32 %ret
+}
+
+define i32 @tgt(%struct1 %init_val) {
+ %x = alloca %struct1, align 8
+ %y = alloca %struct2, align 8
+ %y1 = bitcast %struct2* %y to %struct1*
+ store %struct1 %init_val, %struct1* %y1
+ %gepn1 = getelementptr inbounds %struct2, %struct2* %y, i32 0, i32 0, i32 0
+ store i32 0, i32* %gepn1, align 8
+ %gepn2 = getelementptr inbounds %struct2, %struct2* %y, i32 0, i32 0, i32 1
+ store i32 0, i32* %gepn2, align 4
+ %bit1 = bitcast %struct1* %x to i64*
+ %bit2 = bitcast %struct2* %y to i64*
+ %gep1 = getelementptr %struct2, %struct2* %y, i32 0, i32 0, i32 0
+ %ret = load i32, i32* %gep1
+ ret i32 %ret
+}
+
+; ERROR: Value mismatch

MODIFY
tests/alive-tv/bugs/pr1014-nolocal.srctgt.ll
tests/alive-tv/bugs/pr1014-nolocal.srctgt.ll
@@ -3,10 +3,11 @@ target datalayout = "e-p:32:32"
@str = constant [3 x i8] undef
@str2 = constant [4 x i8] undef
-define i32 @src(i32* %v0) {
+define i32 @src(i32 %v0_init) {
entry:
+ %v0 = alloca i32, align 4
%tmp = getelementptr [3 x i8], [3 x i8]* @str, i32 0, i32 0
- call void (i8*, ...) @scanf(i8* %tmp, i32* %v0)
+ store i32 %v0_init, i32* %v0
%tmp1 = load i32, i32* %v0
%ovm = and i32 %tmp1, 32
%ov3 = add i32 %ovm, 145
@@ -19,10 +20,11 @@ return:
ret i32 0
}
-define i32 @tgt(i32* %v0) {
+define i32 @tgt(i32 %v0_init) {
entry:
+ %v0 = alloca i32, align 4
%tmp = getelementptr [3 x i8], [3 x i8]* @str, i32 0, i32 0
- call void (i8*, ...) @scanf(i8* %tmp, i32* %v0)
+ store i32 %v0_init, i32* %v0
%tmp1 = load i32, i32* %v0
%ovm = and i32 %tmp1, 32
%ov110 = or i32 %ovm, 9
@@ -35,7 +37,6 @@ return:
}
-declare void @scanf(i8*, ...)
declare void @printf(i8*, ...)
; ERROR: Source is more defined than target

ADD
tests/alive-tv/bugs/pr23599-nolocal.srctgt.ll
+; https://bugs.llvm.org/show_bug.cgi?id=23599
+
+%struct.ether_addr = type { [6 x i8] }
+%struct.ether_header = type { [6 x i8], [6 x i8] }
+
+@glb = global %struct.ether_header undef
+
+define void @src(%struct.ether_addr* nocapture readonly %ether_src, %struct.ether_addr* nocapture readonly %ether_dst) {
+entry:
+ %eth = alloca %struct.ether_header, align 1
+ %0 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %eth, i64 0, i32 0, i64 0
+ call void @llvm.lifetime.start(i64 12, i8* %0)
+ call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 12, i32 1, i1 false)
+ %arraydecay = getelementptr inbounds %struct.ether_header, %struct.ether_header* %eth, i64 0, i32 1, i64 0
+ %1 = getelementptr inbounds %struct.ether_addr, %struct.ether_addr* %ether_src, i64 0, i32 0, i64 0
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* %arraydecay, i8* %1, i64 6, i32 1, i1 false)
+ %2 = getelementptr inbounds %struct.ether_addr, %struct.ether_addr* %ether_dst, i64 0, i32 0, i64 0
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %2, i64 6, i32 1, i1 false)
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.ether_header* @glb to i8*), i8* %0, i64 12, i32 1, i1 false)
+ call void @llvm.lifetime.end(i64 12, i8* %0)
+ ret void
+}
+
+define void @tgt(%struct.ether_addr* nocapture readonly %ether_src, %struct.ether_addr* nocapture readonly %ether_dst) {
+entry:
+ %eth = alloca %struct.ether_header, align 1
+ %0 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %eth, i64 0, i32 0, i64 0
+ call void @llvm.lifetime.start(i64 12, i8* %0)
+ %arraydecay = getelementptr inbounds %struct.ether_header, %struct.ether_header* %eth, i64 0, i32 1, i64 0
+ %1 = getelementptr inbounds %struct.ether_addr, %struct.ether_addr* %ether_src, i64 0, i32 0, i64 0
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* %arraydecay, i8* %1, i64 6, i32 1, i1 false)
+ %2 = getelementptr inbounds %struct.ether_addr, %struct.ether_addr* %ether_dst, i64 0, i32 0, i64 0
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %2, i64 6, i32 1, i1 false)
+ %3 = getelementptr i8, i8* %0, i64 6
+ call void @llvm.memset.p0i8.i64(i8* %3, i8 0, i64 6, i32 1, i1 false)
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.ether_header* @glb to i8*), i8* %0, i64 12, i32 1, i1 false)
+ call void @llvm.lifetime.end(i64 12, i8* %0)
+ ret void
+}
+
+
+declare void @llvm.lifetime.start(i64, i8* nocapture)
+
+declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)
+
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1)
+
+declare void @_Z5PrintRK12ether_header(%struct.ether_header* dereferenceable(12))
+
+declare void @llvm.lifetime.end(i64, i8* nocapture)
+
+; ERROR: Mismatch in memory

DELETE
tests/alive-tv/bugs/pr24179-unrolled.srctgt.ll
-declare i1 @use(i32)
-
-define void @src() {
- entry:
- %t = alloca i32
- %v = load i32, i32* %t
- %c = call i1 @use(i32 %v)
- store i32 46, i32* %t
- store i32 42, i32* %t
- %v2 = load i32, i32* %t
- %c2 = call i1 @use(i32 %v2)
- store i32 46, i32* %t
- store i32 42, i32* %t
- ret void
-}
-
-define void @tgt() {
-entry:
- %c = tail call i1 @use(i32 undef)
- %c2 = tail call i1 @use(i32 undef)
- ret void
-}
-
-; ERROR: Source is more defined than target

MODIFY
tests/alive-tv/bugs/pr24179.srctgt.ll
tests/alive-tv/bugs/pr24179.srctgt.ll
-; To detect a bug from this, infinite loop should be supported
+; TEST-ARGS: -src-unroll=2 -tgt-unroll=2
declare i1 @use(i32)
@@ -29,3 +29,5 @@ loop: ; preds = %loop, %entry
exit: ; preds = %loop
ret void
}
+
+; ERROR: Source is more defined than target

ADD
tests/alive-tv/bugs/pr29034-unroll.src.ll
+; https://bugs.llvm.org/show_bug.cgi?id=29034
+
+%struct._MUSIC_OP_API_ = type { %struct._FILE_OPERATE_*, %struct.__MUSIC_API* }
+%struct._FILE_OPERATE_ = type { %struct._FILE_OPERATE_INIT_*, %struct._lg_dev_info_* }
+%struct._FILE_OPERATE_INIT_ = type { i32, i32, i32, i32, i32*, i8*, i32 }
+%struct._lg_dev_info_ = type { %struct.os_event, i32, i32, %struct._lg_dev_hdl_*, i8, i8, i8, i8, i8 }
+%struct.os_event = type { i8, i32, i8*, %union.anon }
+%union.anon = type { %struct.event_cnt }
+%struct.event_cnt = type { i16 }
+%struct._lg_dev_hdl_ = type { i8*, i8*, i8*, i8*, i8* }
+%struct.__MUSIC_API = type <{ i8*, i8*, i32, %struct._DEC_API, %struct._DEC_API_IO*, %struct._FS_BRK_POINT* }>
+%struct._DEC_API = type { %struct._DEC_PHY*, i8*, i8*, i8* (i8*)*, i32* (i8*)*, i8*, %struct._AAC_DEFAULT_SETTING, i32, i32, i8*, %struct.decoder_inf*, i32, i8, i8*, i8, i8* }
+%struct._DEC_PHY = type { i8*, %struct.__audio_decoder_ops*, i8*, %struct.if_decoder_io, %struct.if_dec_file*, i8*, i32 (i8*)*, i32, i8, %struct.__FF_FR }
+%struct.__audio_decoder_ops = type { i8*, i32 (i8*, %struct.if_decoder_io*, i8*)*, i32 (i8*)*, i32 (i8*, i32)*, %struct.decoder_inf* (i8*)*, i32 (i8*)*, i32 (i8*)*, i32 (...)*, i32 (...)*, i32 (...)*, void (i8*, i32)*, void (i8*, i32, i8*, i32)*, i32 (i8*, i32, i8*)* }
+%struct.if_decoder_io = type { i8*, i32 (i8*, i32, i8*, i32, i8)*, i32 (i8*, i32, i8*)*, void (i8*, i8*, i32)*, i32 (i8*)*, i32 (i8*, i32, i32)* }
+%struct.if_dec_file = type { i32 (i8*, i8*, i32)*, i32 (i8*, i32, i32)* }
+%struct.__FF_FR = type { i32, i32, i8, i8, i8 }
+%struct._AAC_DEFAULT_SETTING = type { i32, i32, i32 }
+%struct.decoder_inf = type { i16, i16, i32, i32 }
+%struct._DEC_API_IO = type { i8*, i8*, i16 (i8*, i8*, i16)*, i32 (i8*, i8, i32)*, i32 (%struct.decoder_inf*, i32)*, %struct.__OP_IO, i32, i32 }
+%struct.__OP_IO = type { i8*, i8* (i8*, i8*, i32)* }
+%struct._FS_BRK_POINT = type { %struct._FS_BRK_INFO, i32, i32 }
+%struct._FS_BRK_INFO = type { i32, i32, [8 x i8], i8, i8, i16 }
+
+@.str = external hidden unnamed_addr constant [10 x i8], align 1
+
+define void @music_task(i8* nocapture readnone %p, %struct._MUSIC_OP_API_* %mapi_init) {
+entry:
+ %mapi = alloca %struct._MUSIC_OP_API_*, align 8
+ %0 = bitcast %struct._MUSIC_OP_API_** %mapi to i8*
+ call void @llvm.lifetime.start(i64 8, i8* %0) #4
+ store %struct._MUSIC_OP_API_* %mapi_init, %struct._MUSIC_OP_API_** %mapi, align 8
+ %call = call i32 @music_decoder_init(%struct._MUSIC_OP_API_** nonnull %mapi) #5
+ br label %while.cond
+
+while.cond.loopexit: ; preds = %while.cond2
+ br label %while.cond
+
+while.cond: ; preds = %while.cond.loopexit, %entry
+ %1 = load %struct._MUSIC_OP_API_*, %struct._MUSIC_OP_API_** %mapi, align 8
+ %dop_api = getelementptr inbounds %struct._MUSIC_OP_API_, %struct._MUSIC_OP_API_* %1, i64 0, i32 1
+ %2 = load %struct.__MUSIC_API*, %struct.__MUSIC_API** %dop_api, align 8
+ %file_num = getelementptr inbounds %struct.__MUSIC_API, %struct.__MUSIC_API* %2, i64 0, i32 2
+ %3 = bitcast i32* %file_num to i8*
+ %call1 = call i32 @music_play_api(%struct._MUSIC_OP_API_* %1, i32 33, i32 0, i32 28, i8* %3) #5
+ br label %while.cond2
+
+while.cond2: ; preds = %while.cond2.backedge, %while.cond
+ %err.0 = phi i32 [ %call1, %while.cond ], [ %err.0.be, %while.cond2.backedge ]
+ switch i32 %err.0, label %sw.default [
+ i32 0, label %while.cond.loopexit
+ i32 35, label %sw.bb
+ i32 11, label %sw.bb7
+ i32 12, label %sw.bb13
+ i32 255, label %return
+ ]
+
+sw.bb: ; preds = %while.cond2
+ %4 = load %struct._MUSIC_OP_API_*, %struct._MUSIC_OP_API_** %mapi, align 8
+ %dop_api4 = getelementptr inbounds %struct._MUSIC_OP_API_, %struct._MUSIC_OP_API_* %4, i64 0, i32 1
+ %5 = load %struct.__MUSIC_API*, %struct.__MUSIC_API** %dop_api4, align 8
+ %file_num5 = getelementptr inbounds %struct.__MUSIC_API, %struct.__MUSIC_API* %5, i64 0, i32 2
+ %6 = load i32, i32* %file_num5, align 1
+ %call6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6) #6
+ br label %while.cond2.backedge
+
+sw.bb7: ; preds = %while.cond2
+ %7 = load %struct._MUSIC_OP_API_*, %struct._MUSIC_OP_API_** %mapi, align 8
+ %dop_api8 = getelementptr inbounds %struct._MUSIC_OP_API_, %struct._MUSIC_OP_API_* %7, i64 0, i32 1
+ %8 = load %struct.__MUSIC_API*, %struct.__MUSIC_API** %dop_api8, align 8
+ %file_num9 = getelementptr inbounds %struct.__MUSIC_API, %struct.__MUSIC_API* %8, i64 0, i32 2
+ store i32 1, i32* %file_num9, align 1
+ %9 = bitcast i32* %file_num9 to i8*
+ %call12 = call i32 @music_play_api(%struct._MUSIC_OP_API_* %7, i32 34, i32 0, i32 24, i8* %9) #5
+ br label %while.cond2.backedge
+
+sw.bb13: ; preds = %while.cond2
+ %10 = load %struct._MUSIC_OP_API_*, %struct._MUSIC_OP_API_** %mapi, align 8
+ %dop_api14 = getelementptr inbounds %struct._MUSIC_OP_API_, %struct._MUSIC_OP_API_* %10, i64 0, i32 1
+ %11 = load %struct.__MUSIC_API*, %struct.__MUSIC_API** %dop_api14, align 8 %file_num15 = getelementptr inbounds %struct.__MUSIC_API, %struct.__MUSIC_API* %11, i64 0, i32 2
+ store i32 1, i32* %file_num15, align 1
+ %12 = bitcast i32* %file_num15 to i8*
+ %call18 = call i32 @music_play_api(%struct._MUSIC_OP_API_* %10, i32 35, i32 0, i32 26, i8* %12) #5
+ br label %while.cond2.backedge
+
+sw.default: ; preds = %while.cond2
+ %13 = load %struct._MUSIC_OP_API_*, %struct._MUSIC_OP_API_** %mapi, align 8
+ %call19 = call i32 @music_play_api(%struct._MUSIC_OP_API_* %13, i32 33, i32 0, i32 22, i8* null) #5
+ br label %while.cond2.backedge
+
+while.cond2.backedge: ; preds = %sw.default, %sw.bb13, %sw.bb7, %sw.bb
+ %err.0.be = phi i32 [ %call19, %sw.default ], [ %call18, %sw.bb13 ], [ %call12, %sw.bb7 ], [ 0, %sw.bb ]
+ br label %while.cond2
+
+return:
+ ret void
+}
+
+declare void @llvm.lifetime.start(i64, i8* nocapture)
+
+declare i32 @music_decoder_init(%struct._MUSIC_OP_API_**)
+
+declare i32 @music_play_api(%struct._MUSIC_OP_API_*, i32, i32, i32, i8*)
+
+declare i32 @printf(i8* nocapture readonly, ...)
+
+; ERROR: Source is more defined than target

ADD
tests/alive-tv/bugs/pr29034-unroll.tgt.ll
+%struct._MUSIC_OP_API_ = type { %struct._FILE_OPERATE_*, %struct.__MUSIC_API* }
+%struct._FILE_OPERATE_ = type { %struct._FILE_OPERATE_INIT_*, %struct._lg_dev_info_* }
+%struct._FILE_OPERATE_INIT_ = type { i32, i32, i32, i32, i32*, i8*, i32 }
+%struct._lg_dev_info_ = type { %struct.os_event, i32, i32, %struct._lg_dev_hdl_*, i8, i8, i8, i8, i8 }
+%struct.os_event = type { i8, i32, i8*, %union.anon }
+%union.anon = type { %struct.event_cnt }
+%struct.event_cnt = type { i16 }
+%struct._lg_dev_hdl_ = type { i8*, i8*, i8*, i8*, i8* }
+%struct.__MUSIC_API = type <{ i8*, i8*, i32, %struct._DEC_API, %struct._DEC_API_IO*, %struct._FS_BRK_POINT* }>
+%struct._DEC_API = type { %struct._DEC_PHY*, i8*, i8*, i8* (i8*)*, i32* (i8*)*, i8*, %struct._AAC_DEFAULT_SETTING, i32, i32, i8*, %struct.decoder_inf*, i32, i8, i8*, i8, i8* }
+%struct._DEC_PHY = type { i8*, %struct.__audio_decoder_ops*, i8*, %struct.if_decoder_io, %struct.if_dec_file*, i8*, i32 (i8*)*, i32, i8, %struct.__FF_FR }
+%struct.__audio_decoder_ops = type { i8*, i32 (i8*, %struct.if_decoder_io*, i8*)*, i32 (i8*)*, i32 (i8*, i32)*, %struct.decoder_inf* (i8*)*, i32 (i8*)*, i32 (i8*)*, i32 (...)*, i32 (...)*, i32 (...)*, void (i8*, i32)*, void (i8*, i32, i8*, i32)*, i32 (i8*, i32, i8*)* }
+%struct.if_decoder_io = type { i8*, i32 (i8*, i32, i8*, i32, i8)*, i32 (i8*, i32, i8*)*, void (i8*, i8*, i32)*, i32 (i8*)*, i32 (i8*, i32, i32)* }
+%struct.if_dec_file = type { i32 (i8*, i8*, i32)*, i32 (i8*, i32, i32)* }
+%struct.__FF_FR = type { i32, i32, i8, i8, i8 }
+%struct._AAC_DEFAULT_SETTING = type { i32, i32, i32 }
+%struct.decoder_inf = type { i16, i16, i32, i32 }
+%struct._DEC_API_IO = type { i8*, i8*, i16 (i8*, i8*, i16)*, i32 (i8*, i8, i32)*, i32 (%struct.decoder_inf*, i32)*, %struct.__OP_IO, i32, i32 }
+%struct.__OP_IO = type { i8*, i8* (i8*, i8*, i32)* }
+%struct._FS_BRK_POINT = type { %struct._FS_BRK_INFO, i32, i32 }
+%struct._FS_BRK_INFO = type { i32, i32, [8 x i8], i8, i8, i16 }
+
+@.str = external hidden unnamed_addr constant [10 x i8], align 1
+
+define void @music_task(i8* nocapture readnone %p, %struct._MUSIC_OP_API_* %mapi_init) {
+entry:
+ %mapi = alloca %struct._MUSIC_OP_API_*, align 8
+ %0 = bitcast %struct._MUSIC_OP_API_** %mapi to i8*
+ call void @llvm.lifetime.start(i64 8, i8* %0)
+ store %struct._MUSIC_OP_API_* %mapi_init, %struct._MUSIC_OP_API_** %mapi, align 8
+ %call = call i32 @music_decoder_init(%struct._MUSIC_OP_API_** nonnull %mapi)
+ br label %while.cond
+
+while.cond.loopexit: ; preds = %while.cond2
+ br label %while.cond
+
+while.cond: ; preds = %while.cond.loopexit, %entry
+ %1 = load %struct._MUSIC_OP_API_*, %struct._MUSIC_OP_API_** %mapi, align 8
+ %dop_api = getelementptr inbounds %struct._MUSIC_OP_API_, %struct._MUSIC_OP_API_* %1, i64 0, i32 1
+ %2 = load %struct.__MUSIC_API*, %struct.__MUSIC_API** %dop_api, align 8
+ %file_num = getelementptr inbounds %struct.__MUSIC_API, %struct.__MUSIC_API* %2, i64 0, i32 2
+ %3 = bitcast i32* %file_num to i8*
+ %call1 = call i32 @music_play_api(%struct._MUSIC_OP_API_* %1, i32 33, i32 0, i32 28, i8* %3)
+ br label %while.cond2
+
+while.cond2: ; preds = %while.cond2.backedge, %while.cond
+ %err.0 = phi i32 [ %call1, %while.cond ], [ %err.0.be, %while.cond2.backedge ]
+ %4 = load %struct._MUSIC_OP_API_*, %struct._MUSIC_OP_API_** %mapi, align 8
+ %dop_api8 = getelementptr inbounds %struct._MUSIC_OP_API_, %struct._MUSIC_OP_API_* %4, i64 0, i32 1
+ %5 = load %struct.__MUSIC_API*, %struct.__MUSIC_API** %dop_api8, align 8
+ %file_num9 = getelementptr inbounds %struct.__MUSIC_API, %struct.__MUSIC_API* %5, i64 0, i32 2
+ %6 = bitcast i32* %file_num9 to i8*
+ store i32 1, i32* %file_num9, align 1
+ switch i32 %err.0, label %sw.default [
+ i32 0, label %while.cond.loopexit
+ i32 35, label %sw.bb
+ i32 11, label %sw.bb7
+ i32 12, label %sw.bb13
+ i32 255, label %return
+ ]
+
+sw.bb: ; preds = %while.cond2
+ %7 = load i32, i32* %file_num9, align 1
+ %call6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
+ br label %while.cond2.backedge
+
+sw.bb7: ; preds = %while.cond2
+ %call12 = call i32 @music_play_api(%struct._MUSIC_OP_API_* %4, i32 34, i32 0, i32 24, i8* %6)
+ br label %while.cond2.backedge
+
+sw.bb13: ; preds = %while.cond2
+ %call18 = call i32 @music_play_api(%struct._MUSIC_OP_API_* %4, i32 35, i32 0, i32 26, i8* %6)
+ br label %while.cond2.backedge
+
+sw.default: ; preds = %while.cond2
+ %call19 = call i32 @music_play_api(%struct._MUSIC_OP_API_* %4, i32 33, i32 0, i32 22, i8* null)
+ br label %while.cond2.backedge
+
+while.cond2.backedge: ; preds = %sw.default, %sw.bb13, %sw.bb7, %sw.bb
+ %err.0.be = phi i32 [ %call19, %sw.default ], [ %call18, %sw.bb13 ], [ %call12, %sw.bb7 ], [ 0, %sw.bb ]
+ br label %while.cond2
+
+return:
+ ret void
+}
+
+declare void @llvm.lifetime.start(i64, i8* nocapture)
+
+declare i32 @music_decoder_init(%struct._MUSIC_OP_API_**)
+
+declare i32 @music_play_api(%struct._MUSIC_OP_API_*, i32, i32, i32, i8*)
+
+declare i32 @printf(i8* nocapture readonly, ...)
\ No newline at end of file

MODIFY
tests/alive-tv/bugs/pr29034.src.ll
tests/alive-tv/bugs/pr29034.src.ll
; https://bugs.llvm.org/show_bug.cgi?id=29034
-; To detect this bug, backedges of loops should be encoded (currently they are
-; assumed to be never taken)
+; To detect this bug,
+; 1. infinite loops should be supported
+; 2. function calls should be able to update escaped local blocks
; ModuleID = 'music_task.bc'
source_filename = "music.i"
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"

ADD
tests/alive-tv/bugs/pr36437-bounded.srctgt.ll
+; TEST-ARGS: -src-unroll=2 -tgt-unroll=2
+; https://bugs.llvm.org/show_bug.cgi?id=36437
+; Bound the # of iterations to 2, because the problematic execution
+; happens at the second iteration.
+
+define i32 @src() {
+entry:
+ store i32 3, i32* @a, align 4
+ br label %for.body
+
+for.body: ; preds = %entry, %for.body
+ %d.05 = phi i32 [ 0, %entry ], [ -1, %for.body ]
+ %0 = load i32*, i32** @c, align 8
+ %1 = load i32, i32* %0, align 4
+ %and = and i32 %1, %d.05
+ store i32 %and, i32* %0, align 4
+ %2 = load i32, i32* @a, align 4
+ %sext = shl i32 %2, 16
+ %conv3 = ashr exact i32 %sext, 16
+ %sub = add nsw i32 %conv3, -1
+ store i32 %sub, i32* @a, align 4
+ %cmp = icmp eq i32 %sub, 1
+ br i1 %cmp, label %for.end, label %for.body
+
+for.end: ; preds = %for.body
+ %3 = load i32, i32* @b, align 4
+ %call = tail call i32 (i8*, ...) @print(i8* nonnull dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
+ ret i32 0
+}
+
+define i32 @tgt() {
+entry:
+ store i32 3, i32* @a, align 4
+ br label %for.body
+
+for.body: ; preds = %entry, %for.body
+ %phiofops = phi i32 [ 0, %entry ], [ %1, %for.body ]
+ %d.05 = phi i32 [ 0, %entry ], [ -1, %for.body ]
+ %0 = load i32*, i32** @c, align 8
+ %1 = load i32, i32* %0, align 4
+ store i32 %phiofops, i32* %0, align 4
+ %2 = load i32, i32* @a, align 4
+ %sext = shl i32 %2, 16
+ %conv3 = ashr exact i32 %sext, 16
+ %sub = add nsw i32 %conv3, -1
+ store i32 %sub, i32* @a, align 4
+ %cmp = icmp eq i32 %sub, 1
+ br i1 %cmp, label %for.end, label %for.body
+
+for.end: ; preds = %for.body
+ %3 = load i32, i32* @b, align 4
+ %call = tail call i32 (i8*, ...) @print(i8* nonnull dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
+ ret i32 0
+}
+
+; ERROR: Source is more defined than target
+
+@b = global i32 2, align 4
+@c = global i32* @b, align 8
+@a = common global i32 0, align 4
+@.str = private unnamed_addr constant [15 x i8] c"checksum = %X\0A\00", align 1
+declare i32 @print(i8*, ...)

MODIFY
tests/alive-tv/bugs/pr46591.srctgt.ll
tests/alive-tv/bugs/pr46591.srctgt.ll
+; Found by Alive2
; https://bugs.llvm.org/show_bug.cgi?id=46591
target triple = "x86_64--"

MODIFY
tests/alive-tv/bugs/pr48125.srctgt.ll
tests/alive-tv/bugs/pr48125.srctgt.ll
+; Found by Alive2
; TEST-ARGS: -src-unroll=8 -tgt-unroll=8
; ERROR: Source is more defined than target

MODIFY
tests/alive-tv/bugs/pr48126.srctgt.ll
tests/alive-tv/bugs/pr48126.srctgt.ll
+; Found by Alive2
; TEST-ARGS: -src-unroll=4 -tgt-unroll=4
; ERROR: Source is more defined than target

MODIFY
tests/alive-tv/bugs/pr48127.srctgt.ll
tests/alive-tv/bugs/pr48127.srctgt.ll
+; Found by Alive
; TEST-ARGS: -src-unroll=4 -tgt-unroll=4
; ERROR: Source is more defined than target

test: add inf-loop-unrolled/local-unescaped version of LLVM bugzilla reports (#581)