Skip to content

Commit

Permalink
Cleanup and simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-penev committed Nov 30, 2023
1 parent 4ef015a commit cc88c41
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import subprocess
import lit.util
import lit.formats

from lit.llvm import llvm_config

# name: The name of this test suite.
config.name = 'clad'
# Tweak PATH for Win32
Expand Down Expand Up @@ -326,30 +324,20 @@ if libcudart_path is not None:
if(config.have_enzyme):
config.available_features.add('Enzyme')

# Ask llvm-config about assertion mode.
# Ask llvm-config about assertion mode and build-mode.
try:
llvm_config_cmd = subprocess.Popen(
[os.path.join(llvm_tools_dir, 'llvm-config'), '--assertion-mode'],
[os.path.join(llvm_tools_dir, 'llvm-config'), '--assertion-mode --build-mode'],
stdout = subprocess.PIPE,
env=config.environment)
except OSError:
print("Could not find llvm-config in " + llvm_tools_dir)
exit(42)

if re.search(r'ON', llvm_config_cmd.stdout.read().decode('ascii')):
res=llvm_config_cmd.stdout.read().decode('ascii')
if re.search(r'ON', res):
config.available_features.add('asserts')
llvm_config_cmd.wait()

# Ask llvm-config about build-mode.
try:
llvm_config_cmd = subprocess.Popen(
[os.path.join(llvm_tools_dir, 'llvm-config'), '--build-mode'],
stdout = subprocess.PIPE,
env=config.environment)
except OSError:
print("Could not find llvm-config in " + llvm_tools_dir)
exit(42)

if re.search(r'[Dd][Ee][Bb][Uu][Gg]', llvm_config_cmd.stdout.read().decode('ascii')):
if re.search(r'[Dd][Ee][Bb][Uu][Gg]', res):
config.available_features.add('debug')

llvm_config_cmd.wait()

0 comments on commit cc88c41

Please sign in to comment.