<commit_before># Taken from utils/lit/tests in the LLVM tree and hacked together to support
# our tests.

# -*- Python -*-

import os
import sys

import lit.formats

# name: The name of this test suite.
config.name = 'subzero'

# testFormat: The test format to use to interpret tests.
config.test_format = lit.formats.ShTest()

# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.ll']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
config.test_exec_root = config.test_source_root
config.target_triple = '(unused)'

src_root = os.path.abspath(os.path.join(config.test_source_root, '..'))
bin_root = src_root
config.substitutions.append(('%{src_root}', src_root))
config.substitutions.append(('%{python}', sys.executable))

# Finding LLVM binary tools. All tools used in the tests must be listed in
# the llvmbintools list.
llvmbinpath = os.path.abspath(os.environ.get('LLVM_BIN_PATH'))

# Finding Subzero tools
llvm2icetool = os.path.join(bin_root, 'llvm2ice')
config.substitutions.append(
  ('%llvm2iceinsts', ' '.join([os.path.join(bin_root, 'llvm2iceinsts.py'),
                               '--llvm2ice', llvm2icetool,
                               '--llvm-bin-path', llvmbinpath
                             ])))
config.substitutions.append(('%llvm2ice', llvm2icetool))
config.substitutions.append(('%szdiff', os.path.join(bin_root, 'szdiff.py')))

llvmbintools = ['FileCheck']

for tool in llvmbintools:
  config.substitutions.append((tool, os.path.join(llvmbinpath, tool)))

# Add a feature to detect the Python version.
config.available_features.add("python%d.%d" % (sys.version_info[0],
                                               sys.version_info[1]))

# Debugging output
def dbg(s):
  print '[DBG] %s' % s

dbg('bin_root = %s' % bin_root)
dbg('llvmbinpath = %s' % llvmbinpath)

<commit_msg>Subzero: Add 'not' to the list of LLVM commands in lit.cfg.<commit_after># Taken from utils/lit/tests in the LLVM tree and hacked together to support
# our tests.

# -*- Python -*-

import os
import re
import sys

import lit.formats

# name: The name of this test suite.
config.name = 'subzero'

# testFormat: The test format to use to interpret tests.
config.test_format = lit.formats.ShTest()

# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.ll']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
config.test_exec_root = config.test_source_root
config.target_triple = '(unused)'

src_root = os.path.abspath(os.path.join(config.test_source_root, '..'))
bin_root = src_root
config.substitutions.append(('%{src_root}', src_root))
config.substitutions.append(('%{python}', sys.executable))

# Finding LLVM binary tools. All tools used in the tests must be listed in
# the llvmbintools list.
llvmbinpath = os.path.abspath(os.environ.get('LLVM_BIN_PATH'))

# Finding Subzero tools
llvm2icetool = os.path.join(bin_root, 'llvm2ice')
config.substitutions.append(
  ('%llvm2iceinsts', ' '.join([os.path.join(bin_root, 'llvm2iceinsts.py'),
                               '--llvm2ice', llvm2icetool,
                               '--llvm-bin-path', llvmbinpath
                             ])))
config.substitutions.append(('%llvm2ice', llvm2icetool))
config.substitutions.append(('%szdiff', os.path.join(bin_root, 'szdiff.py')))

llvmbintools = [r"\bFileCheck\b", r"\bnot\b"]

for tool in llvmbintools:
  # The re.sub() line is adapted from one of LLVM's lit.cfg files.
  # Extract the tool name from the pattern.  This relies on the tool
  # name being surrounded by \b word match operators.  If the
  # pattern starts with "| ", include it in the string to be
  # substituted.
  substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
                        r"\2" + llvmbinpath + "/" + r"\4",
                        tool)
  config.substitutions.append((tool, substitution))

# Add a feature to detect the Python version.
config.available_features.add("python%d.%d" % (sys.version_info[0],
                                               sys.version_info[1]))

# Debugging output
def dbg(s):
  print '[DBG] %s' % s

dbg('bin_root = %s' % bin_root)
dbg('llvmbinpath = %s' % llvmbinpath)
{'fraction_non_alphanumeric': 0.13639543017020284, 'fraction_numerical': 0.00559570995570063, 'mean_word_length': 3.3245967741935485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1730451', 'n_tokens_mistral': 1476, 'n_tokens_neox': 1457, 'n_words': 361}