aboutsummaryrefslogtreecommitdiff
path: root/test/tsan/signal_longjmp.cc
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:52:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:52:19 +0000
commit5c909fa013fc285f010a95e8d387e0ef3412da9c (patch)
tree1059d068ad281f4776ff44cd414574f99a460023 /test/tsan/signal_longjmp.cc
parentf31bcc68c72371a2bf63aead9f3373a1ff2053b6 (diff)
downloadsrc-5c909fa013fc285f010a95e8d387e0ef3412da9c.tar.gz
src-5c909fa013fc285f010a95e8d387e0ef3412da9c.zip
Vendor import of compiler-rt trunk r256633:vendor/compiler-rt/compiler-rt-trunk-r256633
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=292925 svn path=/vendor/compiler-rt/compiler-rt-trunk-r256633/; revision=292926; tag=vendor/compiler-rt/compiler-rt-trunk-r256633
Diffstat (limited to 'test/tsan/signal_longjmp.cc')
-rw-r--r--test/tsan/signal_longjmp.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/tsan/signal_longjmp.cc b/test/tsan/signal_longjmp.cc
index 2525c898887b..45e24626cbfa 100644
--- a/test/tsan/signal_longjmp.cc
+++ b/test/tsan/signal_longjmp.cc
@@ -1,10 +1,14 @@
// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
// Test case for longjumping out of signal handler:
-// https://code.google.com/p/thread-sanitizer/issues/detail?id=75
+// https://github.com/google/sanitizers/issues/482
// Longjmp assembly has not been implemented for mips64 yet
// XFAIL: mips64
+// This test fails on powerpc64 BE (VMA=44), a segmentation fault
+// error happens at the second assignment
+// "((volatile int *volatile)mem)[1] = 1".
+// XFAIL: powerpc64-unknown-linux-gnu
#include <setjmp.h>
#include <signal.h>
@@ -12,6 +16,12 @@
#include <stdio.h>
#include <sys/mman.h>
+#ifdef __APPLE__
+#define SIGNAL_TO_HANDLE SIGBUS
+#else
+#define SIGNAL_TO_HANDLE SIGSEGV
+#endif
+
sigjmp_buf fault_jmp;
volatile int fault_expected;
@@ -44,7 +54,7 @@ int main() {
exit(1);
}
- if (sigaction(SIGSEGV, &act, NULL)) {
+ if (sigaction(SIGNAL_TO_HANDLE, &act, NULL)) {
perror("sigaction");
exit(1);
}