[compiler-rt] r213523 - [lsan] Allow using ucontext.h in the test on OSX.

Alexander Potapenko glider at google.com
Mon Jul 21 06:35:10 PDT 2014

Author: glider
Date: Mon Jul 21 08:35:09 2014
New Revision: 213523

URL: http://llvm.org/viewvc/llvm-project?rev=213523&view=rev
[lsan] Allow using ucontext.h in the test on OSX.


Modified: compiler-rt/trunk/test/lsan/TestCases/swapcontext.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lsan/TestCases/swapcontext.cc?rev=213523&r1=213522&r2=213523&view=diff
--- compiler-rt/trunk/test/lsan/TestCases/swapcontext.cc (original)
+++ compiler-rt/trunk/test/lsan/TestCases/swapcontext.cc Mon Jul 21 08:35:09 2014
@@ -6,6 +6,11 @@
 // RUN: not %run %t foo 2>&1 | FileCheck %s
 #include <stdio.h>
+#if defined(__APPLE__)
+// Note: ucontext.h is deprecated on OSX, so this test may stop working
+// someday. We define _XOPEN_SOURCE to keep using ucontext.h for now.
+#define _XOPEN_SOURCE 1
 #include <ucontext.h>
 #include <unistd.h>

More information about the llvm-commits mailing list