about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2023-03-20 17:50:30 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-03-22 17:02:03 +0000
commit5c8610ec5e6fd54746b2934bcb0a4d63ef20b0bf (patch)
tree2b8f8fbe82f4c5fa56dc52c1524dc42edb90fce9
parent1398e960ec9aca3f0ceac5e37062631986b9c2a8 (diff)
downloadklee-5c8610ec5e6fd54746b2934bcb0a4d63ef20b0bf.tar.gz
Explicitly check if 32bit support is enabled for testing
Ignore test in the first place, if no 32bit is enabled.
-rw-r--r--CMakeLists.txt8
-rw-r--r--test/Programs/pcregrep.c1
-rw-r--r--test/lit.cfg4
-rw-r--r--test/lit.site.cfg.in1
4 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cf01df24..59c6094a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -430,8 +430,14 @@ message(STATUS "KLEE_RUNTIME_BUILD_TYPE: ${KLEE_RUNTIME_BUILD_TYPE}")
 include(CheckCSourceRuns)
 cmake_push_check_state()
 set(CMAKE_REQUIRED_FLAGS "-m32")
-check_c_source_runs("int main(int argc, char** argv){return 0;}" M32_SUPPORTED)
+check_c_source_runs("int main(int argc, char** argv){return 0;}" CHECK_M32_SUPPORT)
 cmake_pop_check_state()
+if (NOT CHECK_M32_SUPPORT)
+  set(M32_SUPPORTED 0)
+else()
+  set(M32_SUPPORTED 1)
+endif()
+
 message(STATUS "32bit platform supported: ${M32_SUPPORTED}")
 
 set(KLEE_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/klee/runtime")
diff --git a/test/Programs/pcregrep.c b/test/Programs/pcregrep.c
index ba5c79db..7bcef671 100644
--- a/test/Programs/pcregrep.c
+++ b/test/Programs/pcregrep.c
@@ -1,3 +1,4 @@
+// REQUIRES: 32bit-support
 // RUN: %clang -m32 %s -emit-llvm %O0opt -c -o %t1.bc
 // RUN: rm -rf %t.klee-out
 // RUN: %klee --output-dir=%t.klee-out --libc=klee --exit-on-error %t1.bc 2 2
diff --git a/test/lit.cfg b/test/lit.cfg
index c935ab8e..ca7fe20f 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -224,6 +224,10 @@ if 'WSL_DISTRO_NAME' in os.environ and 'WSL_INTEROP' in os.environ:
 else:
   config.available_features.add('not-wsl-2')
 
+# m32 support
+config.available_features.add('{}32bit-support'.format('' if config.have_32bit_support else 'not-'))
+
+
 # Sanitizer
 config.available_features.add('{}asan'.format('' if config.have_asan else 'not-'))
 config.available_features.add('{}ubsan'.format('' if config.have_ubsan else 'not-'))
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 849062b1..c7063057 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -38,6 +38,7 @@ config.enable_zlib = True if @HAVE_ZLIB_H@ == 1 else False
 config.have_asan = True if @IS_ASAN_BUILD@ == 1 else False
 config.have_ubsan = True if @IS_UBSAN_BUILD@ == 1 else False
 config.have_msan = True if @IS_MSAN_BUILD@ == 1 else False
+config.have_32bit_support = True if @M32_SUPPORTED@ == 1 else False
 
 # Add sanitizer list
 config.environment['LSAN_OPTIONS'] = "suppressions=@KLEE_UTILS_DIR@/sanitizers/lsan.txt"