diff --git a/test/lit.cfg b/test/lit.cfg index 4723cc12e..a20cfeea9 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -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 @@ -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()