[Sanitizer] Fix failing sanitizer tests

The new pass manager was enabled by default [1].

The commit message states the following relevant differences:
  * The inliner works slightly differently
  * -O1 does some amount of inlining

These tests are affected because they specify `-O1` and then check the
reported stack trace.

[1] https://reviews.llvm.org/D95380

Differential Revision: https://reviews.llvm.org/D96198
This commit is contained in:
Julian Lettner 2021-02-05 21:31:22 -08:00
parent cc2c45dc54
commit 04af72c542
9 changed files with 11 additions and 11 deletions

View File

@ -3,7 +3,7 @@
// RUN: echo "fun:*Blacklisted_Thread2*" > %t.blacklist
// RUN: echo "fun:*CallTouchGlobal*" >> %t.blacklist
// RUN: %clangxx_tsan -O1 %s -fsanitize-blacklist=%t.blacklist -o %t
// RUN: %clangxx_tsan %s -fsanitize-blacklist=%t.blacklist -o %t
// RUN: %deflake %run %t 2>&1 | FileCheck %s
#include "test.h"

View File

@ -1,4 +1,4 @@
// RUN: %clang_tsan -O1 %s -o %t
// RUN: %clang_tsan %s -o %t
// RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOZUPP
// RUN: %env_tsan_opts=suppressions='%s.supp':print_suppressions=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SUPP

View File

@ -1,4 +1,4 @@
// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
// RUN: %clang_tsan %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
#include <pthread.h>
#include <stdio.h>

View File

@ -1,4 +1,4 @@
// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
// RUN: %clang_tsan %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
#include <pthread.h>
#include <stdio.h>

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
// RUN: %clangxx_tsan %s -o %t && %deflake %run %t | FileCheck %s
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>

View File

@ -1,5 +1,5 @@
// RUN: echo "race_top:TopFunction" > %t.supp
// RUN: %clangxx_tsan -O1 %s -o %t
// RUN: %clangxx_tsan %s -o %t
// RUN: %env_tsan_opts=suppressions='%t.supp' %run %t 2>&1 | FileCheck %s
// RUN: rm %t.supp
#include "test.h"

View File

@ -46,14 +46,14 @@ int main() {
return 0;
}
// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
// RUN: %clang_tsan %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
// Also check that functions instrumentation can be configured by either driver
// or legacy flags:
// RUN: %clangxx_tsan -O1 %s -o %t -fno-sanitize-thread-func-entry-exit && %deflake %run %t 2>&1 \
// RUN: %clangxx_tsan %s -o %t -fno-sanitize-thread-func-entry-exit && %deflake %run %t 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FUNC-ENTRY-EXIT-OFF %s
// RUN: %clangxx_tsan -O1 %s -o %t -mllvm -tsan-instrument-func-entry-exit=0 && %deflake %run %t 2>&1 \
// RUN: %clangxx_tsan %s -o %t -mllvm -tsan-instrument-func-entry-exit=0 && %deflake %run %t 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FUNC-ENTRY-EXIT-OFF %s
// CHECK: WARNING: ThreadSanitizer: data race

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
// RUN: %clangxx_tsan %s -o %t && %deflake %run %t | FileCheck %s
#include "test.h"
int X = 0;

View File

@ -1,4 +1,4 @@
// RUN: %clangxx -fsanitize=return %gmlt %s -O3 -o %t
// RUN: %clangxx -fsanitize=return %gmlt %s -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