Skip to content

Commit a651f5d

Browse files
committed
[Tools] add options to tv
1 parent 938ed5b commit a651f5d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tools/tv.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222

2323
parser.add_argument('--opt-bin', type=Path, help='path to the opt binary', required=True)
2424
parser.add_argument('--passes', type=str, help='passes to run with opt', default='instcombine')
25-
parser.add_argument('-j', '--jobs', type=int, help='number of parallel jobs', default=os.cpu_count() // 8)
2625

26+
parser.add_argument('--no-undef', action='store_true', help='disable undef inputs')
27+
parser.add_argument('--no-poison', action='store_true', help='disable poison inputs')
28+
29+
parser.add_argument('-j', '--jobs', type=int, help='number of parallel jobs', default=os.cpu_count() // 8)
2730
parser.add_argument('--cont', action='store_true', help='continue TV even if the first miscompilation is found')
2831

2932
# Placeholder removed as args parsing is moved under __main__
@@ -36,8 +39,12 @@ def run_opt(d: Path, timeout: str = '2s', passes: str = 'instcombine', save_resu
3639
return opt_result if save_result else None
3740
return None
3841

39-
def run_tv(before: Path, after: Path, timeout: str = '2m'):
42+
def run_tv(before: Path, after: Path, timeout: str = '2m', no_undef: bool = False, no_poison: bool = False):
4043
tv_args = ['timeout', timeout, 'alive-tv', after.absolute().as_posix(), before.absolute().as_posix()]
44+
if no_undef:
45+
tv_args.append('--disable-undef-input')
46+
if no_poison:
47+
tv_args.append('--disable-poison-input')
4148
tv_p = sp.run(tv_args, capture_output=True, text=True)
4249
if "1 incorrect" in tv_p.stdout:
4350
return "incorrect"

0 commit comments

Comments
 (0)