Skip to content

Commit 93a0ff2

Browse files
committed
[profile] Update test to make condition non-redundant.
The tests contain a redundant condition in the else if branch that can be simplified with fb13dcf. Update the condition used to prevent it from getting removed. Alive2 proof for check removal: https://alive2.llvm.org/ce/z/iFBnsy
1 parent 108766f commit 93a0ff2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler-rt/test/profile/Linux/counter_promo_for.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ __attribute__((noinline)) void foo(int n, int N) {
4646
for (i = 0; i < N; i++) {
4747
if (i < n + 1)
4848
bar(1);
49-
else if (i < n - 1)
49+
else if (i == n - 1)
5050
bar(2);
5151
else
5252
bar(3);

compiler-rt/test/profile/Linux/counter_promo_while.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ __attribute__((noinline)) void foo(int n, int N) {
4141
while (i < N) {
4242
if (i < n + 1)
4343
bar(1);
44-
else if (i < n - 1)
44+
else if (i == n - 1)
4545
bar(2);
4646
else
4747
bar(3);

0 commit comments

Comments
 (0)