[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / tools / llvm-reduce / mir / instr-reduce.py
blob75e2cc54bbcfa6f4b4ca42c031a71957c400e2af
1 from subprocess import run, PIPE
2 import re
3 import sys
5 llc = run( [ 'llc', '-disable-symbolication','-verify-machineinstrs', '-mtriple=riscv32', '-run-pass=none', '-o', '-', sys.argv[1]], stdout=PIPE, stderr=PIPE )
7 stdout = llc.stdout.decode()
9 p = re.compile(r'^\s*%[0-9]+:gpr = ADDI %[0-9]+, 5$', flags=re.MULTILINE)
11 if (llc.returncode == 0 and p.search(stdout)):
12 print('This is interesting!')
13 sys.exit(0)
14 else:
15 print('This is NOT interesting!')
16 sys.exit(1)