aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/builtins/Unit/clear_cache_test.c16
-rw-r--r--test/builtins/Unit/fixunsdfdi_test.c3
-rw-r--r--test/builtins/Unit/fixunssfdi_test.c2
-rw-r--r--test/lsan/TestCases/strace_test.cc1
-rw-r--r--test/lsan/lit.common.cfg5
5 files changed, 20 insertions, 7 deletions
diff --git a/test/builtins/Unit/clear_cache_test.c b/test/builtins/Unit/clear_cache_test.c
index 3c893018545f..0ef704fcde88 100644
--- a/test/builtins/Unit/clear_cache_test.c
+++ b/test/builtins/Unit/clear_cache_test.c
@@ -18,9 +18,20 @@ void __clear_cache(void* start, void* end)
if (!FlushInstructionCache(GetCurrentProcess(), start, end-start))
exit(1);
}
+
+static uintptr_t get_page_size() {
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+ return si.dwPageSize;
+}
#else
+#include <unistd.h>
#include <sys/mman.h>
extern void __clear_cache(void* start, void* end);
+
+static uintptr_t get_page_size() {
+ return sysconf(_SC_PAGE_SIZE);
+}
#endif
@@ -56,8 +67,9 @@ unsigned char execution_buffer[128];
int main()
{
// make executable the page containing execution_buffer
- char* start = (char*)((uintptr_t)execution_buffer & (-4095));
- char* end = (char*)((uintptr_t)(&execution_buffer[128+4096]) & (-4095));
+ uintptr_t page_size = get_page_size();
+ char* start = (char*)((uintptr_t)execution_buffer & (-page_size));
+ char* end = (char*)((uintptr_t)(&execution_buffer[128+page_size]) & (-page_size));
#if defined(_WIN32)
DWORD dummy_oldProt;
MEMORY_BASIC_INFORMATION b;
diff --git a/test/builtins/Unit/fixunsdfdi_test.c b/test/builtins/Unit/fixunsdfdi_test.c
index 1ddc5340b03d..3998482876f3 100644
--- a/test/builtins/Unit/fixunsdfdi_test.c
+++ b/test/builtins/Unit/fixunsdfdi_test.c
@@ -95,9 +95,6 @@ int main()
if (test__fixunsdfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL))
return 1;
- if (test__fixunsdfdi(0x1.p+64, 0xFFFFFFFFFFFFFFFFLL))
- return 1;
-
#if !TARGET_LIBGCC
if (test__fixunsdfdi(-0x1.FFFFFFFFFFFFFp+62, 0))
return 1;
diff --git a/test/builtins/Unit/fixunssfdi_test.c b/test/builtins/Unit/fixunssfdi_test.c
index 166153cb5b51..812457a002de 100644
--- a/test/builtins/Unit/fixunssfdi_test.c
+++ b/test/builtins/Unit/fixunssfdi_test.c
@@ -79,8 +79,6 @@ int main()
return 1;
if (test__fixunssfdi(0x1.000000p+63F, 0x8000000000000000LL))
return 1;
- if (test__fixunssfdi(0x1.000000p+64F, 0xFFFFFFFFFFFFFFFFLL))
- return 1;
if (test__fixunssfdi(0x1.FFFFFEp+62F, 0x7FFFFF8000000000LL))
return 1;
if (test__fixunssfdi(0x1.FFFFFCp+62F, 0x7FFFFF0000000000LL))
diff --git a/test/lsan/TestCases/strace_test.cc b/test/lsan/TestCases/strace_test.cc
index b3568d0b44e8..b25e05753848 100644
--- a/test/lsan/TestCases/strace_test.cc
+++ b/test/lsan/TestCases/strace_test.cc
@@ -1,4 +1,5 @@
// Test that lsan reports a proper error when running under strace.
+// REQUIRES: strace
// RUN: %clangxx_lsan %s -o %t
// RUN: not strace -o /dev/null %run %t 2>&1 | FileCheck %s
diff --git a/test/lsan/lit.common.cfg b/test/lsan/lit.common.cfg
index 6002e2d69444..8580eec33d28 100644
--- a/test/lsan/lit.common.cfg
+++ b/test/lsan/lit.common.cfg
@@ -4,6 +4,8 @@
import os
+import lit.util
+
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
@@ -29,6 +31,9 @@ else:
lit_config.fatal("Unknown LSan test mode: %r" % lsan_lit_test_mode)
config.name += config.name_suffix
+if lit.util.which('strace'):
+ config.available_features.add('strace')
+
clang_cflags = ["-O0", config.target_cflags] + config.debug_info_flags
clang_cxxflags = config.cxx_mode_flags + clang_cflags
lsan_incdir = config.test_source_root + "/../"