aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/tools/llvm-reduce/Inputs/reduce-distinct-metadata.py
blob: 155031ab5d8aa74adc558a6b00845637de89d0b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Helper script for distinct metadata reduction test

import sys
import re

input = open(sys.argv[1], "r").read().splitlines()

depth_map = {"0": 1, "1": 3, "2": 3, "3": 2, "4": 1}


for i in range(len(depth_map)):
    counter = 0
    for line in input:
        if re.match(rf".*interesting_{i}.*", line) != None:
            counter += 1
    if counter != depth_map[str(i)]:
        sys.exit(1)

sys.exit(0)