Index: compiler-rt/test/sanitizer_common/CMakeLists.txt =================================================================== --- compiler-rt/test/sanitizer_common/CMakeLists.txt +++ compiler-rt/test/sanitizer_common/CMakeLists.txt @@ -11,6 +11,7 @@ list(APPEND SUPPORTED_TOOLS tsan) list(APPEND SUPPORTED_TOOLS msan) list(APPEND SUPPORTED_TOOLS lsan) + list(APPEND SUPPORTED_TOOLS ubsan) endif() # Create a separate config for each tool we support. Index: compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cc @@ -20,6 +20,7 @@ // Remove when fixed: https://github.com/google/sanitizers/issues/637 // UNSUPPORTED: msan // UNSUPPORTED: tsan +// UNSUPPORTED: ubsan #include #include Index: compiler-rt/test/sanitizer_common/TestCases/Linux/assert.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/assert.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/assert.cc @@ -6,6 +6,7 @@ // FIXME: implement in other sanitizers, not just asan. // XFAIL: msan // XFAIL: tsan +// XFAIL: ubsan #include #include #include Index: compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cc @@ -57,5 +57,6 @@ // CHECK-tsan: rw-p {{.*}} [trace 1] // CHECK-tsan: rw-p {{.*}} [trace header 1] -// Nothing interesting with standalone LSan. +// Nothing interesting with standalone LSan and UBSan. // CHECK-lsan: decorate_proc_maps +// CHECK-ubsan: decorate_proc_maps Index: compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cc @@ -1,5 +1,5 @@ // RUN: %clangxx %s -o %t && %run not %t 1 2>&1 | FileCheck %s -// UNSUPPORTED: lsan, android +// UNSUPPORTED: lsan,ubsan,android #include #include Index: compiler-rt/test/sanitizer_common/TestCases/Linux/hard_rss_limit_mb_test.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/hard_rss_limit_mb_test.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/hard_rss_limit_mb_test.cc @@ -14,6 +14,7 @@ // XFAIL: lsan // XFAIL: tsan // XFAIL: msan +// XFAIL: ubsan #include #include Index: compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cc @@ -6,6 +6,7 @@ // FIXME: implement in other sanitizers, not just asan. // XFAIL: msan // XFAIL: tsan +// XFAIL: ubsan // // FIXME: seems to fail on ARM // REQUIRES: x86_64-target-arch Index: compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cc @@ -1,5 +1,5 @@ // RUN: %clang %s -o %t && %run %t -// XFAIL: lsan +// XFAIL: ubsan,lsan #include #include Index: compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cc @@ -1,5 +1,5 @@ // RUN: %clangxx %s -o %t && %run %t 2>&1 | FileCheck %s -// UNSUPPORTED: android +// UNSUPPORTED: android, ubsan #include #include Index: compiler-rt/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc @@ -1,7 +1,7 @@ // RUN: %clangxx -O0 -g %s -lutil -o %t && %run %t // This test depends on the glibc layout of struct sem_t and checks that we // don't leave sem_t::private uninitialized. -// UNSUPPORTED: android, lsan-x86 +// UNSUPPORTED: android, lsan-x86, ubsan #include #include #include Index: compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc @@ -14,6 +14,7 @@ // XFAIL: lsan // XFAIL: tsan // XFAIL: msan +// XFAIL: ubsan #include #include #include Index: compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc +++ compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc @@ -1,6 +1,7 @@ // RUN: %clang -w -O0 %s -o %t && %run %t 2>&1 | FileCheck %s // UNSUPPORTED: lsan // UNSUPPORTED: msan +// UNSUPPORTED: ubsan #include int main() { int a; Index: compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc +++ compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc @@ -10,6 +10,7 @@ // FIXME: implement SEGV handler in other sanitizers, not just asan. // XFAIL: msan // XFAIL: tsan +// XFAIL: ubsan volatile int *null = 0; Index: compiler-rt/test/sanitizer_common/TestCases/Posix/fpe.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Posix/fpe.cc +++ compiler-rt/test/sanitizer_common/TestCases/Posix/fpe.cc @@ -6,6 +6,7 @@ // FIXME: implement in other sanitizers, not just asan. // XFAIL: msan // XFAIL: tsan +// XFAIL: ubsan // // FIXME: seems to fail on ARM // REQUIRES: x86_64-target-arch Index: compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc +++ compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc @@ -8,6 +8,7 @@ // the last line of main function. The problem doesn't reproduce with ASan because // quarantine prohibits memory block reuse for different allocations. // XFAIL: lsan-x86 +// XFAIL: ubsan #include #include Index: compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_fd_test.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_fd_test.cc +++ compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_fd_test.cc @@ -8,6 +8,7 @@ // FIXME: implement SEGV handler in other sanitizers, not just asan. // XFAIL: msan // XFAIL: tsan +// XFAIL: ubsan #include #include Index: compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cc +++ compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cc @@ -4,6 +4,7 @@ // Hooks are not implemented for lsan. // XFAIL: lsan +// XFAIL: ubsan #include #include Index: compiler-rt/test/sanitizer_common/TestCases/corelimit.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/corelimit.cc +++ compiler-rt/test/sanitizer_common/TestCases/corelimit.cc @@ -1,5 +1,5 @@ // RUN: %clangxx -O0 %s -o %t && %run %t -// UNSUPPORTED: lsan +// UNSUPPORTED: lsan,ubsan #include #include Index: compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cc +++ compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cc @@ -2,6 +2,7 @@ // Malloc/free hooks are not supported on Windows. // XFAIL: win32 +// XFAIL: ubsan #include #include Index: compiler-rt/test/sanitizer_common/TestCases/options-include.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/options-include.cc +++ compiler-rt/test/sanitizer_common/TestCases/options-include.cc @@ -1,4 +1,5 @@ // RUN: %clangxx -O0 %s -o %t +// UNSUPPORTED: ubsan // Recursive include: options1 includes options2 // RUN: echo "symbolize=1" > %t.options1.txt Index: compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc +++ compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc @@ -4,6 +4,7 @@ // RUN: %env_tool_opts=symbolize_inline_frames=false:stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s --check-prefix=NOINLINE // UNSUPPORTED: darwin +// XFAIL: ubsan #include Index: compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cc +++ compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cc @@ -2,7 +2,7 @@ // // REQUIRES: has_sancovcc,stable-runtime // UNSUPPORTED: i386-darwin -// XFAIL: tsan +// XFAIL: ubsan,tsan // // RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,bb,no-prune 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 3 // RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,bb 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 2 Index: compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cc +++ compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cc @@ -1,6 +1,7 @@ // Tests trace pc guard coverage collection. // // REQUIRES: has_sancovcc,stable-runtime +// UNSUPPORTED: ubsan // XFAIL: tsan,darwin,powerpc64,s390x,mips // // RUN: DIR=%t_workdir @@ -68,5 +69,5 @@ // // CHECK-SANCOV: Ignoring {{.*}}_1.so and its coverage because __sanitizer_cov* functions were not found. // CHECK-SANCOV: Ignoring {{.*}}_2.so and its coverage because __sanitizer_cov* functions were not found. -// CHECK-SANCOV-NEXT: sanitizer_coverage_trace_pc_guard-dso.cc:29 foo -// CHECK-SANCOV-NEXT: sanitizer_coverage_trace_pc_guard-dso.cc:34 main +// CHECK-SANCOV-NEXT: sanitizer_coverage_trace_pc_guard-dso.cc:[[@LINE-42]] foo +// CHECK-SANCOV-NEXT: sanitizer_coverage_trace_pc_guard-dso.cc:[[@LINE-38]] main Index: compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc =================================================================== --- compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc +++ compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc @@ -1,7 +1,7 @@ // Tests trace pc guard coverage collection. // // REQUIRES: has_sancovcc,stable-runtime -// UNSUPPORTED: i386-darwin +// UNSUPPORTED: ubsan,i386-darwin // XFAIL: tsan,powerpc64,s390x,mips // // RUN: DIR=%t_workdir @@ -36,7 +36,7 @@ // CHECK-NEXT: foo // CHECK-NEXT: SanitizerCoverage: ./sanitizer_coverage_trace_pc_guard.{{.*}}.sancov: 2 PCs written // -// CHECK-SANCOV: sanitizer_coverage_trace_pc_guard.cc:23 foo -// CHECK-SANCOV-NEXT: sanitizer_coverage_trace_pc_guard.cc:28 main +// CHECK-SANCOV: sanitizer_coverage_trace_pc_guard.cc:[[@LINE-16]] foo +// CHECK-SANCOV-NEXT: sanitizer_coverage_trace_pc_guard.cc:[[@LINE-12]] main // // CHECK-NOCOV-NOT: SanitizerCoverage Index: compiler-rt/test/sanitizer_common/lit.common.cfg =================================================================== --- compiler-rt/test/sanitizer_common/lit.common.cfg +++ compiler-rt/test/sanitizer_common/lit.common.cfg @@ -18,6 +18,9 @@ elif config.tool_name == "lsan": tool_cflags = ["-fsanitize=leak"] tool_options = "LSAN_OPTIONS" +elif config.tool_name == "ubsan": + tool_cflags = ["-fsanitize=undefined"] + tool_options = "UBSAN_OPTIONS" else: lit_config.fatal("Unknown tool for sanitizer_common tests: %r" % config.tool_name)