-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split C++11-specific tests in their own file
- Loading branch information
Showing
4 changed files
with
45 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters