Skip to content

Commit

Permalink
Split C++11-specific tests in their own file
Browse files Browse the repository at this point in the history
  • Loading branch information
Geod24 committed Jan 7, 2019
1 parent c8edd5b commit 8fb0c82
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 30 deletions.
31 changes: 31 additions & 0 deletions test/runnable/cpp11.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// REQUIRED_ARGS: -stdc++=c++11
// EXTRA_CPP_SOURCES: cpp11.cpp
// CXXFLAGS: -std=c++11

/****************************************/
alias nullptr_t = typeof(null);

// Only run on OSX/Windows because the compilers are too old
// and nullptr_t gets substituted
version (FreeBSD)
version = IgnoreNullptrTest;
version (Linux)
version = IgnoreNullptrTest;

version (IgnoreNullPtrTest) { void test17() {} }
else
{
extern (C++) void testnull(nullptr_t);
extern (C++) void testnullnull(nullptr_t, nullptr_t);

void test17()
{
testnull(null);
testnullnull(null, null);
}
}

void main()
{
test17();
}
17 changes: 1 addition & 16 deletions test/runnable/cppa.d
Original file line number Diff line number Diff line change
Expand Up @@ -727,20 +727,6 @@ void test16()
static assert(0);
}

/****************************************/
/+ FIXME: Requires C++11 compiler.
alias nullptr_t = typeof(null);
extern (C++) void testnull(nullptr_t);
extern (C++) void testnullnull(nullptr_t, nullptr_t);
void test17()
{
testnull(null);
testnullnull(null, null);
}
+/

/****************************************/

struct S13707
Expand Down Expand Up @@ -1624,7 +1610,6 @@ void main()
test13289();
test15();
test16();
//test17();
func13707();
func13932(S13932!(-1)(0));
foo13337(S13337());
Expand All @@ -1650,6 +1635,6 @@ void main()
test18966();
test19134();
test18955();

printf("Success\n");
}
13 changes: 13 additions & 0 deletions test/runnable/extra-files/cpp11.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <assert.h>
#include <cstddef>

void testnull(std::nullptr_t n)
{
assert(n == nullptr);
}

void testnullnull(std::nullptr_t n1, std::nullptr_t n2)
{
assert(n1 == nullptr);
assert(n2 == nullptr);
}
14 changes: 0 additions & 14 deletions test/runnable/extra-files/cppb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,20 +464,6 @@ unsigned long testul(unsigned long ul)
return ul + sizeof(unsigned long);
}

/******************************************/
/* FIXME: Requires C++11 compiler.
void testnull(nullptr_t n)
{
assert(n == NULL);
}
void testnullnull(nullptr_t n1, nullptr_t n2)
{
assert(n1 == NULL);
assert(n2 == NULL);
}
*/

/******************************************/

struct S13707
Expand Down

0 comments on commit 8fb0c82

Please sign in to comment.