[clang] Fix ForStmt mustprogress handling
D86841 had an error where for statements with no conditional were
required to make progress. This is not true, this patch removes that
line, and adds regression tests.
Differential Revision: https://reviews.llvm.org/D91075
diff --git a/clang/test/CodeGen/attr-mustprogress-1.cpp b/clang/test/CodeGen/attr-mustprogress-1.cpp
index 6d53d2d..945d746 100644
--- a/clang/test/CodeGen/attr-mustprogress-1.cpp
+++ b/clang/test/CodeGen/attr-mustprogress-1.cpp
@@ -8,6 +8,16 @@
int b = 0;
// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK-LABEL: @_Z2f0v(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: br label [[FOR_COND:%.*]]
+// CHECK: for.cond:
+// CHECK-NOT: br label [[FOR_COND]], !llvm.loop !{{.*}}
+void f0() {
+ for (; ;) ;
+}
+
+// CHECK: Function Attrs: noinline nounwind optnone
// CHECK-LABEL: @_Z2f1v(
// CHECK-NEXT: entry:
// CHECK-NEXT: br label [[FOR_COND:%.*]]