brintos

brintos / llvm-project-archived public Read only

0
0
Text · 395 B · e211a8c Raw
20 lines · python
1import subprocess2import sys3 4opt = subprocess.run(5    ["opt", "-passes=print<loops>", "-disable-output", sys.argv[1]],6    stdout=subprocess.PIPE,7    stderr=subprocess.PIPE,8)9 10stdout = opt.stdout.decode()11 12pattern = "Loop at depth 1 containing"13 14if pattern in opt.stderr.decode():15    print("This is interesting!")16    sys.exit(0)17else:18    print("This is NOT interesting!")19    sys.exit(1)20