diff options
| author | Howard Hinnant <hhinnant@apple.com> | 2010-08-10 20:48:29 +0000 |
|---|---|---|
| committer | Howard Hinnant <hhinnant@apple.com> | 2010-08-10 20:48:29 +0000 |
| commit | eb2692571fab1cc9996c0b972aee5e1c48ae0989 (patch) | |
| tree | 862739b146f0c019b81347516a3b305b88d74ec8 /libcxx/test | |
| parent | 3b870f045f571507c541ae386473c665ee110f3f (diff) | |
| download | bcm5719-llvm-eb2692571fab1cc9996c0b972aee5e1c48ae0989.tar.gz bcm5719-llvm-eb2692571fab1cc9996c0b972aee5e1c48ae0989.zip | |
patch by Jesse Towner, and bug fix by Sebastian Redl
llvm-svn: 110724
Diffstat (limited to 'libcxx/test')
| -rw-r--r-- | libcxx/test/language.support/support.types/nullptr_t.pass.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/libcxx/test/language.support/support.types/nullptr_t.pass.cpp b/libcxx/test/language.support/support.types/nullptr_t.pass.cpp index b169f1a75f8..204d740c3ec 100644 --- a/libcxx/test/language.support/support.types/nullptr_t.pass.cpp +++ b/libcxx/test/language.support/support.types/nullptr_t.pass.cpp @@ -24,9 +24,10 @@ int main() "sizeof(std::nullptr_t) == sizeof(void*)"); A* p = 0; assert(p == nullptr); + assert(nullptr == p); +#if !((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ <= 5)) + // GCC 4.2 through 4.5 can't handle this void (A::*pmf)() = 0; -#ifdef __clang__ - // GCC 4.2 can't handle this assert(pmf == nullptr); #endif int A::*pmd = 0; @@ -41,4 +42,20 @@ int main() assert(!(nullptr != nullptr)); assert(!(nullptr < nullptr)); assert(!(nullptr > nullptr)); + assert(!(&a1 == nullptr)); + assert(!(nullptr == &a1)); + assert(&a1 != nullptr); + assert(nullptr != &a1); + assert(nullptr < &a1); + assert(nullptr <= &a1); + assert(!(nullptr < p)); + assert(nullptr <= p); + assert(!(&a1 < nullptr)); + assert(!(&a1 <= nullptr)); + assert(!(p < nullptr)); + assert(p <= nullptr); + assert(!(nullptr > &a1)); + assert(!(nullptr >= &a1)); + assert(!(nullptr > p)); + assert(nullptr >= p); } |

