Skip to content

Commit

Permalink
[UBsan] Enable subset of unit tests for OpenBSD
Browse files Browse the repository at this point in the history
Reviewers: kubamracek, krytarowski

Reviewed By: krytarowski

Differential Revision: https://reviews.llvm.org/D48805

llvm-svn: 336053
  • Loading branch information
devnexen committed Jun 30, 2018
1 parent 1b7b9b8 commit c33f35f
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/test/lit.common.cfg
Expand Up @@ -355,7 +355,7 @@ for postfix in ["2", "1", ""]:
if config.host_os == 'Darwin':
config.substitutions.append( ("%ld_flags_rpath_exe" + postfix, '-Wl,-rpath,@executable_path/ %dynamiclib' + postfix) )
config.substitutions.append( ("%ld_flags_rpath_so" + postfix, '-install_name @rpath/`basename %dynamiclib{}`'.format(postfix)) )
elif config.host_os == 'FreeBSD' or config.host_os == 'NetBSD':
elif config.host_os in ('FreeBSD', 'NetBSD', 'OpenBSD'):
config.substitutions.append( ("%ld_flags_rpath_exe" + postfix, "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix) )
config.substitutions.append( ("%ld_flags_rpath_so" + postfix, '') )
elif config.host_os == 'Linux':
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp
Expand Up @@ -4,6 +4,8 @@
// requires the compiler-rt runtime to be able to symbolize stack addresses.
// REQUIRES: can-symbolize
// UNSUPPORTED: android
// Output differs on OpenBSD longer by displaying the values.
// XFAIL: openbsd

// Fails without any suppression.
// RUN: %env_ubsan_opts=halt_on_error=1 not %run %t 2>&1 | FileCheck %s
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc
Expand Up @@ -23,6 +23,8 @@
// Coverage is not yet implemented in TSan.
// XFAIL: ubsan-tsan
// UNSUPPORTED: ubsan-standalone-static
// No coverage support
// UNSUPPORTED: openbsd

volatile int sink;
int main(int argc, char **argv) {
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp
@@ -1,6 +1,8 @@
// RUN: %clangxx -fsanitize=return %gmlt %s -O3 -o %t
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-STACKTRACE
// Error message does not exact what expected
// XFAIL: openbsd

// CHECK: missing_return.cpp:[[@LINE+1]]:5: runtime error: execution reached the end of a value-returning function without returning a value
int f() {
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/ubsan/TestCases/Misc/monitor.cpp
Expand Up @@ -5,6 +5,8 @@
// on Windows.
//
// UNSUPPORTED: win32
// Linkage issue
// XFAIL: openbsd

#include <iostream>

Expand Down
Expand Up @@ -3,6 +3,8 @@
// Verify that we can disable symbolization if needed:
// RUN: %env_ubsan_opts=symbolize=0 %run %t 2>&1 | FileCheck %s --check-prefix=NOSYM
// XFAIL: win32,win64
// Unsupported function flag
// UNSUPPORTED: openbsd

#include <stdint.h>

Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
Expand Up @@ -11,6 +11,8 @@

// RUN: %clangxx -fsanitize=alignment -fno-sanitize-recover=alignment %s -O3 -o %t
// RUN: not %run %t w1 2>&1 | FileCheck %s --check-prefix=CHECK-WILD
// Compilation error make the test fails.
// XFAIL: openbsd

#include <new>

Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp
Expand Up @@ -40,6 +40,8 @@
// UNSUPPORTED: win32
// Suppressions file not pushed to the device.
// UNSUPPORTED: android
// Compilation error
// UNSUPPORTED: openbsd
#include <new>
#include <typeinfo>
#include <assert.h>
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/ubsan/lit.common.cfg
Expand Up @@ -68,7 +68,7 @@ config.substitutions.append( ("%gmlt ", " ".join(config.debug_info_flags) + " ")
config.suffixes = ['.c', '.cc', '.cpp']

# Check that the host supports UndefinedBehaviorSanitizer tests
if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows', 'NetBSD', 'SunOS']:
if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows', 'NetBSD', 'SunOS', 'OpenBSD']:
config.unsupported = True

config.available_features.add('arch=' + config.target_arch)
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/xray/lit.cfg
Expand Up @@ -45,7 +45,7 @@ config.substitutions.append(
# Default test suffixes.
config.suffixes = ['.c', '.cc', '.cpp']

if config.host_os not in ['FreeBSD', 'Linux', 'NetBSD']:
if config.host_os not in ['FreeBSD', 'Linux', 'NetBSD', 'OpenBSD']:
config.unsupported = True
elif '64' not in config.host_arch:
if 'arm' in config.host_arch:
Expand Down

0 comments on commit c33f35f

Please sign in to comment.