Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / utils / lit / tests / Inputs / allow-retries / succeeds-within-limit.py
blobaf80e3ece74bb3a47bf270cdfa506b5c97ce74ec
1 # ALLOW_RETRIES: 5
3 # RUN: "%python" "%s" "%counter"
5 import sys
6 import os
8 counter_file = sys.argv[1]
10 # The first time the test is run, initialize the counter to 1.
11 if not os.path.exists(counter_file):
12 with open(counter_file, "w") as counter:
13 counter.write("1")
15 # Succeed if this is the fourth time we're being run.
16 with open(counter_file, "r") as counter:
17 num = int(counter.read())
18 if num == 4:
19 sys.exit(0)
21 # Otherwise, increment the counter and fail
22 with open(counter_file, "w") as counter:
23 counter.write(str(num + 1))
24 sys.exit(1)