[compiler-rt] r263018 - [test/sanitizer-common] Linux/sanitizer_set_death_callback_test.cc -> Posix/sanitizer_set_death_callback_test.cc
Filipe Cabecinhas via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 9 07:39:49 PST 2016
Author: filcab
Date: Wed Mar 9 09:39:49 2016
New Revision: 263018
URL: http://llvm.org/viewvc/llvm-project?rev=263018&view=rev
Log:
[test/sanitizer-common] Linux/sanitizer_set_death_callback_test.cc -> Posix/sanitizer_set_death_callback_test.cc
Added:
compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc
- copied, changed from r263017, compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sanitizer_set_death_callback_test.cc
Removed:
compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sanitizer_set_death_callback_test.cc
Removed: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sanitizer_set_death_callback_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sanitizer_set_death_callback_test.cc?rev=263017&view=auto
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sanitizer_set_death_callback_test.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sanitizer_set_death_callback_test.cc (removed)
@@ -1,40 +0,0 @@
-// RUN: %clangxx -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
-
-// REQUIRES: stable-runtime
-
-#include <sanitizer/common_interface_defs.h>
-#include <stdio.h>
-
-volatile char *zero = 0;
-
-void Death() {
- fprintf(stderr, "DEATH CALLBACK EXECUTED\n");
-}
-// CHECK: DEATH CALLBACK EXECUTED
-
-char global;
-volatile char *sink;
-
-__attribute__((noinline))
-void MaybeInit(int *uninitialized) {
- if (zero)
- *uninitialized = 1;
-}
-
-__attribute__((noinline))
-void Leak() {
- sink = new char[100]; // trigger lsan report.
-}
-
-int main(int argc, char **argv) {
- int uninitialized;
- __sanitizer_set_death_callback(Death);
- MaybeInit(&uninitialized);
- if (uninitialized) // trigger msan report.
- global = 77;
- sink = new char[100];
- delete[] sink;
- global = sink[0]; // use-after-free: trigger asan/tsan report.
- Leak();
- sink = 0;
-}
Copied: compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc (from r263017, compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sanitizer_set_death_callback_test.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc?p2=compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc&p1=compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/sanitizer_set_death_callback_test.cc&r1=263017&r2=263018&rev=263018&view=diff
==============================================================================
(empty)
More information about the llvm-commits
mailing list