[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

llvm-svn: 302628
This commit is contained in:
Ivan A. Kosarev 2017-05-10 08:06:42 +00:00
parent fc861f511a
commit e73af512a6
1 changed files with 2 additions and 1 deletions

View File

@ -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.