diff options
author | Ivan A. Kosarev <ivan@kosarev.info> | 2017-05-10 08:06:42 +0000 |
---|---|---|
committer | Ivan A. Kosarev <ivan@kosarev.info> | 2017-05-10 08:06:42 +0000 |
commit | 24981c0ced4c5d8b40125c45a48a0c78f984ad4a (patch) | |
tree | b105efd3af2db7db819908c8bbef043e4e28fbe4 /test/safestack | |
parent | 92760a25363fbcd3c9214ffe0d139c8b0f1defa1 (diff) |
[Safestack] Fix the canary test to catch the libc's message regarding stack smashing
By default glibc writes its diagnostics directly to tty so the `2>&1 |`
redirection in the test doesn't catch the *** stack smashing detected ***
message, which in turn breaks printing the lit's progress bar. By defining
the LIBC_FATAL_STDERR_ environment variable we force glibc to direct
diagnostic messages to stderr.
Differential Revision: https://reviews.llvm.org/D32599
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/safestack')
-rw-r--r-- | test/safestack/canary.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/safestack/canary.c b/test/safestack/canary.c index c6b81f243..1ceaa5065 100644 --- a/test/safestack/canary.c +++ b/test/safestack/canary.c @@ -2,7 +2,8 @@ // RUN: %run %t.nossp 2>&1 | FileCheck --check-prefix=NOSSP %s // RUN: %clang_safestack -fstack-protector-all -D_FORTIFY_SOURCE=0 -g %s -o %t.ssp -// RUN: not --crash %run %t.ssp 2>&1 | FileCheck -check-prefix=SSP %s +// RUN: env LIBC_FATAL_STDERR_=1 not --crash %run %t.ssp 2>&1 | \ +// RUN: FileCheck -check-prefix=SSP %s // Test stack canaries on the unsafe stack. |