Index: SingleSource/UnitTests/testcase-CodeGen-1.c =================================================================== --- SingleSource/UnitTests/testcase-CodeGen-1.c +++ SingleSource/UnitTests/testcase-CodeGen-1.c @@ -1,5 +1,5 @@ // COVERAGE: llvm-project/llvm/lib/Analysis/InlineCost.cpp (1 new functions) -// COVERAGE: llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (2 new functions) +// COVERAGE: llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (2 new functions) // COVERAGE: llvm-project/llvm/lib/CodeGen/TargetLoweringBase.cpp (2 new functions) extern void abort(); #ifndef __SIZEOF_INT128__ Index: SingleSource/UnitTests/testcase-CodeGen-2.c =================================================================== --- SingleSource/UnitTests/testcase-CodeGen-2.c +++ SingleSource/UnitTests/testcase-CodeGen-2.c @@ -1,4 +1,4 @@ -// COVERAGE: llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (1 new functions) +// COVERAGE: llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (1 new functions) // COVERAGE: llvm-project/llvm/lib/CodeGen/TargetLoweringBase.cpp (1 new functions) extern void abort(); #ifndef __SIZEOF_INT128__ Index: SingleSource/UnitTests/testcase-CodeGen-3.c =================================================================== --- SingleSource/UnitTests/testcase-CodeGen-3.c +++ SingleSource/UnitTests/testcase-CodeGen-3.c @@ -1,9 +1,9 @@ // COVERAGE: llvm-project/clang/lib/AST/ExprConstant.cpp (1 new functions) -// COVERAGE: llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (1 new functions) +// COVERAGE: llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (1 new functions) // COVERAGE: llvm-project/llvm/lib/CodeGen/TargetLoweringBase.cpp (1 new functions) #include "stdio.h" #ifdef __SIZEOF_INT128__ -typedef __int128 L; // Appears in pr49218.c test case +typedef __int128 L; // Appears in pr49218.c test case #else typedef long long L; #endif @@ -11,13 +11,13 @@ int main() { L i = f; if (i <= 10 + - 41 * +((long)(((int)10) >> ((int)10))) * - ((long)(((int)(i)) % ((int)10))) - - ((long)(((double)(i)) + ((double)10))) - - ((long)(((int)10) ^ ((int)10)))) + 41 * +((long)(((int)10) >> ((int)10))) * + ((long)(((int)(i)) % ((int)10))) - + ((long)(((double)(i)) + ((double)10))) - + ((long)(((int)10) ^ ((int)10)))) do { ++i; - printf("%lld", (long long) i); + printf("%lld", (long long)i); } while (i != 11); return 0; } Index: SingleSource/UnitTests/testcase-Float2Int.c =================================================================== --- SingleSource/UnitTests/testcase-Float2Int.c +++ SingleSource/UnitTests/testcase-Float2Int.c @@ -1,6 +1,6 @@ // COVERAGE: llvm-project/llvm/lib/Transforms/Scalar/Float2Int.cpp (1 new functions) #include "stdio.h" -char b = ' '; +char b = 32; int main() { for (b = ((long)(((double)(b)) * ((double)(b)))); b >= -29; b--) printf("%d", (int)b); Index: SingleSource/UnitTests/testcase-SelectionDAG.c =================================================================== --- /dev/null +++ SingleSource/UnitTests/testcase-SelectionDAG.c @@ -0,0 +1,12 @@ +// COVERAGE: llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (1 new functions) +int a; +int main() { + int b = 0; + for (; a; a = 2 - (0 | a)) { + b++; + if (b <= 4) + continue; + break; + } + return b; +} Index: SingleSource/UnitTests/testcase-SemaStmt-1-IR.ll =================================================================== --- SingleSource/UnitTests/testcase-SemaStmt-1-IR.ll +++ /dev/null @@ -1,46 +0,0 @@ -; ModuleID = 'testcase-SemaStmt-1.c' -source_filename = "testcase-SemaStmt-1.c" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-pc-linux-gnu" - -@d = dso_local local_unnamed_addr global i32 10, align 4 -@b = dso_local local_unnamed_addr global i32 0, align 4 -@c = dso_local local_unnamed_addr global i32 0, align 4 - -; Function Attrs: nounwind uwtable -define dso_local i32 @main() local_unnamed_addr #0 { - store i32 0, ptr @b, align 4, !tbaa !5 - %1 = load i32, ptr @d, align 4, !tbaa !5 - %2 = add nsw i32 %1, 1 - store i32 %2, ptr @d, align 4, !tbaa !5 - store i32 %2, ptr @c, align 4, !tbaa !5 - %3 = icmp eq i32 %2, 11 - br i1 %3, label %5, label %4 - -4: ; preds = %0 - tail call void @abort() #2 - unreachable - -5: ; preds = %0 - ret i32 0 -} - -; Function Attrs: noreturn nounwind -declare void @abort() local_unnamed_addr #1 - -attributes #0 = { nounwind uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -attributes #1 = { noreturn nounwind "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -attributes #2 = { noreturn nounwind } - -!llvm.module.flags = !{!0, !1, !2, !3} -!llvm.ident = !{!4} - -!0 = !{i32 1, !"wchar_size", i32 4} -!1 = !{i32 7, !"PIC Level", i32 2} -!2 = !{i32 7, !"PIE Level", i32 2} -!3 = !{i32 7, !"uwtable", i32 2} -!4 = !{!"Ubuntu clang version 15.0.0-++20220502063808+e547a333a433-1~exp1~20220502183820.463"} -!5 = !{!6, !6, i64 0} -!6 = !{!"int", !7, i64 0} -!7 = !{!"omnipotent char", !8, i64 0} -!8 = !{!"Simple C/C++ TBAA"} Index: SingleSource/UnitTests/testcase-SemaStmt-1.c =================================================================== --- SingleSource/UnitTests/testcase-SemaStmt-1.c +++ /dev/null @@ -1,11 +0,0 @@ -// COVERAGE: llvm-project/clang/lib/Sema/SemaStmt.cpp (1 new functions) -// Compilation of this code should give unused value warning on return value of function declared with const attribute -int b, c, d = 10; -int main(void) { - __builtin_expect(1 ? b = 0 : 0, d++); // __builtin_expect used in other PRs test cases: like pr43385.c and pr85156.c - - c = d; - if (d != 11) - __builtin_abort(); - return 0; -} Index: SingleSource/UnitTests/testcase-SimplifyIndVar.c =================================================================== --- /dev/null +++ SingleSource/UnitTests/testcase-SimplifyIndVar.c @@ -0,0 +1,24 @@ +// COVERAGE: llvm-project/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp (1 new functions) +short a; +void foo() { + if (a < 0) + __builtin_abort(); +} +int main() { + int b = 8; + while (a++ <= 0) { + b++; + if (b <= 0 + 1 * (b % 40) * (double)0 - 0 - 0 - + ((040) * ((b))) * ((((int)(b)) << ((int)(b)))) + + ((long)(((double)(b)) - ((double)0))) + + ((long)(((double)0) - ((double)(b)))) - + ((short)(((double)(b)) - ((double)0))) + + ((long)(((int)0) ^ ((int)0))) - + ((long)(((double)(b)) + ((double)0)))) + break; + } + foo(); + if (b != 9) + __builtin_abort(); + return 0; +} Index: SingleSource/UnitTests/testcase-StmtPrinter.c =================================================================== --- /dev/null +++ SingleSource/UnitTests/testcase-StmtPrinter.c @@ -0,0 +1,21 @@ +// COVERAGE: llvm-project/clang/lib/AST/StmtPrinter.cpp (1 new functions) +char a, b, g, h, i; +short c, d, k; +int e, f, j; +void l() { + k = i > 0 || d > 1 >> d << i; + for (; j; j++) + h = c < 0 || h || c << (8 + 2 - (long)0); + g = f + 1 + 2 * 0 * 0; + for (; f < 1; f = 1 + 2 - 0) + b = a + 1 + 2 * 0; + if (b == 0) + __builtin_abort(); +} +int main() { + for (; e < 1; e++) + l(); + if (h != 0) + __builtin_abort(); + return 0; +} Index: SingleSource/UnitTests/testcase-StmtPrinter.reference_output =================================================================== --- /dev/null +++ SingleSource/UnitTests/testcase-StmtPrinter.reference_output @@ -0,0 +1 @@ +exit 0 Index: SingleSource/UnitTests/testcase-clang-lib-1.c =================================================================== --- SingleSource/UnitTests/testcase-clang-lib-1.c +++ SingleSource/UnitTests/testcase-clang-lib-1.c @@ -1,5 +1,5 @@ -// COVERAGE: llvm-project/clang/include/clang/AST/EvaluatedExprVisitor.h (1 new functions) -// COVERAGE: llvm-project/clang/lib/AST/ComputeDependence.cpp (1 new functions) +// COVERAGE: llvm-project/clang/include/clang/AST/EvaluatedExprVisitor.h (1 new functions) +// COVERAGE: llvm-project/clang/lib/AST/ComputeDependence.cpp (1 new functions) // COVERAGE: llvm-project/clang/lib/AST/Expr.cpp (2 new functions) // COVERAGE: llvm-project/clang/lib/CodeGen/CGExprScalar.cpp (1 new functions) // COVERAGE: llvm-project/clang/lib/Parse/ParseExpr.cpp (1 new functions)