Add more bugs from bugzilla, add README
ADD
tests/alive-tv/bugs/README.md
+This folder maintains a set of tests to check that Alive2 does not miss any
+miscompilation that have been reported to Bugzilla (either reported by us or
+others).

ADD
tests/alive-tv/bugs/pr1261.srctgt.ll
+; https://bugs.llvm.org/show_bug.cgi?id=1261
+; This shows that pr1261 was not a bug. :) (which matches with the final conclusion)
+
+define i16 @src(i31 %zzz) {
+entry:
+ %A = sext i31 %zzz to i32
+ %B = add i32 %A, 16384
+ %C = lshr i32 %B, 15
+ %D = trunc i32 %C to i16
+ ret i16 %D
+}
+
+define i16 @tgt(i31 %zzz) {
+entry:
+ %A1 = zext i31 %zzz to i32 ; <i32> [#uses=1]
+ %B = add i32 %A1, 16384 ; <i32> [#uses=1]
+ %C = lshr i32 %B, 15 ; <i32> [#uses=1]
+ %D = trunc i32 %C to i16 ; <i16> [#uses=1]
+ ret i16 %D
+}

ADD
tests/alive-tv/bugs/pr21256.srctgt.ll
+; https://bugs.llvm.org/show_bug.cgi?id=21256
+
+define i32 @src(i32 %X, i32 %Op0) {
+ %Op1 = sub i32 0, %X
+ %r = srem i32 %Op0, %Op1
+ ret i32 %r
+}
+
+define i32 @tgt(i32 %X, i32 %Op0) {
+ %r = srem i32 %Op0, %X
+ ret i32 %r
+}
+
+; ERROR: Source is more defined than target

ADD
tests/alive-tv/bugs/pr23038.srctgt.ll
+; https://bugs.llvm.org/show_bug.cgi?id=23038
+
+define i32 @src(i8 %call) {
+ %conv1 = sitofp i8 %call to float
+ %mul = fmul float %conv1, -3.000000e+00
+ %conv2 = fptosi float %mul to i8
+ %conv3 = sext i8 %conv2 to i32
+ ret i32 %conv3
+}
+
+define i32 @tgt(i8 %call) {
+ %1 = sext i8 %call to i32
+ %mul1 = mul i32 %1, 0 ;; XXX nope
+ %2 = trunc i32 %mul1 to i8
+ %conv3 = sext i8 %2 to i32
+ ret i32 %conv3
+}
+
+; ERROR: Value mismatch

ADD
tests/alive-tv/bugs/pr3720.srctgt.ll
+%struct.st = type <{ i16 }>
+
+define void @src(i8* %p) nounwind {
+entry:
+ %s = alloca %struct.st, align 4 ; <%struct.st*> [#uses=2]
+ %0 = getelementptr %struct.st, %struct.st* %s, i32 0, i32 0 ; <i16*> [#uses=1]
+ store i16 1, i16* %0, align 4
+ %s1 = bitcast %struct.st* %s to i8* ; <i8*> [#uses=1]
+ call void @llvm.memcpy.i32(i8* %p, i8* %s1, i32 2, i32 1)
+ ret void
+}
+
+declare void @llvm.memcpy.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind
+
+define void @tgt(i8* %p) nounwind {
+entry:
+ %p1 = bitcast i8* %p to %struct.st* ; <%struct.st*> [#uses=1]
+ %p1.0 = getelementptr %struct.st, %struct.st* %p1, i32 0, i32 0 ; <i16*> [#uses=1]
+ store i16 1, i16* %p1.0
+ ret void
+}
+
+; ERROR: Source is more defined than target

ADD
tests/alive-tv/bugs/pr37540.srctgt.ll
+; https://bugs.llvm.org/show_bug.cgi?id=37540
+; To check this, !nonnull support is needed
+
+define i1 @src({}** %arg, i1 %arg2) {
+ br i1 %arg2, label %bb1, label %bb2
+
+bb1:
+ %load1 = load {}*, {}** %arg
+ %cmp1 = icmp eq {}* %load1, null
+ ret i1 %cmp1
+
+bb2:
+ %load2 = load {}*, {}** %arg, !nonnull !0
+ %cmp2 = icmp eq {}* %load2, null
+ ret i1 %cmp2
+}
+
+!0 = !{}
+
+define i1 @tgt({}** %arg, i1 %arg2) {
+ br i1 %arg2, label %bb1, label %bb2
+
+bb1: ; preds = %0
+ ret i1 false
+
+bb2: ; preds = %0
+ ret i1 false
+}
+
+; XFAIL: Unsupported metadata: 11

ADD
tests/alive-tv/bugs/pr4374.srctgt.ll
+; https://bugs.llvm.org/show_bug.cgi?id=4374
+; TEST-ARGS: -smt-to=5000
+
+define float @src(float %a, float %b) nounwind {
+entry:
+ %tmp3 = fsub float %a, %b ; <float> [#uses=1]
+ %tmp4 = fsub float -0.000000e+00, %tmp3 ; <float> [#uses=1]
+ ret float %tmp4
+}
+
+define float @tgt(float %a, float %b) nounwind {
+entry:
+ %tmp3 = fsub float %b, %a ; <float> [#uses=1]
+ ret float %tmp3
+}
+
+; ERROR: Value mismatch

Add more bugs from bugzilla, add README (#320)