forked from OSchip/llvm-project
[UBSan] Increase robustness of tests
These UBSan tests assert the absence of runtime errors via `count 0`, which means "expect no output". This fails the test unnecessarily in some environments (e.g., iOS simulator in our case). Alter the test to be a bit more specific and "expect no error" instead of "expect no output". rdar://65503408 Differential Revision: https://reviews.llvm.org/D85155
This commit is contained in:
parent
af3ec731d5
commit
1d7790604c
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clangxx -fsanitize=returns-nonnull-attribute -w %s -O3 -o %t
|
||||
// RUN: %run %t foo 2>&1 | count 0
|
||||
// RUN: %run %t foo 2>&1 | FileCheck %s --check-prefix=NOERROR --allow-empty --implicit-check-not='runtime error'
|
||||
// RUN: %run %t 2>&1 | FileCheck %s
|
||||
// RUN: %clangxx -fsanitize=returns-nonnull-attribute -fno-sanitize-recover=returns-nonnull-attribute -w %s -O3 -o %t.abort
|
||||
// RUN: not %run %t.abort &> /dev/null
|
||||
|
@ -40,3 +40,5 @@ int main(int argc, char **argv) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// NOERROR-NOT: runtime error
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// UNSUPPORTED: android
|
||||
// RUN: %clang -w -fsanitize=nullability-arg,nullability-assign,nullability-return %s -O3 -o %t
|
||||
// RUN: %run %t foo 2>&1 | count 0
|
||||
// RUN: %run %t foo 2>&1 | FileCheck %s --check-prefix=NOERROR --allow-empty --implicit-check-not='runtime error'
|
||||
// RUN: %run %t 2>&1 | FileCheck %s
|
||||
|
||||
// RUN: echo "nullability-arg:nullability.c" > %t.supp
|
||||
|
@ -67,3 +67,5 @@ int main(int argc, char **argv) {
|
|||
nonnull_init2(p);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// NOERROR-NOT: runtime error
|
||||
|
|
Loading…
Reference in New Issue