[compiler-rt] r286166 - [tsan] Change nullptr to NULL in realloc-zero.cc test. Some environments don't have nullptr.

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 13:09:32 PST 2016


This is C code, not C++, and the issue is that some system header on Darwin used to define nullptr for C code, but it doesn't do that anymore.  I think we already have -std=c++11 for all C++ test cases (at least in TSan).  This test case is actually C code, even though the filename has ".cc".  We should change this to be C++ (i.e. change %clang_tsan to %clangxx_tsan), let me do that in a subsequent commit.

Kuba

> On 8 Nov 2016, at 12:14, David Blaikie <dblaikie at gmail.com> wrote:
> 
> These are built by the just-built clang, right? So is it just that on some platforms clang's default language doesn't have nullptr? Perhaps we should add an explicit -std=c++11 to the test case?
> 
> On Mon, Nov 7, 2016 at 2:35 PM Kuba Brecka via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> Author: kuba.brecka
> Date: Mon Nov  7 16:26:13 2016
> New Revision: 286166
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=286166&view=rev <http://llvm.org/viewvc/llvm-project?rev=286166&view=rev>
> Log:
> [tsan] Change nullptr to NULL in realloc-zero.cc test. Some environments don't have nullptr.
> 
> 
> Modified:
>     compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc
> 
> Modified: compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc?rev=286166&r1=286165&r2=286166&view=diff <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc?rev=286166&r1=286165&r2=286166&view=diff>
> ==============================================================================
> --- compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc (original)
> +++ compiler-rt/trunk/test/tsan/Darwin/realloc-zero.cc Mon Nov  7 16:26:13 2016
> @@ -9,7 +9,7 @@
>  #include <sys/mman.h>
> 
>  int main() {
> -  void *p = realloc(nullptr, 0);
> +  void *p = realloc(NULL, 0);
>    if (!p) {
>      abort();
>    }
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161108/5dc44ebd/attachment.html>


More information about the llvm-commits mailing list