Skip to content

Commit

Permalink
Protect nested-exceptions tests under no-exceptions
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D26458

llvm-svn: 286813
  • Loading branch information
Roger Ferrer Ibanez committed Nov 14, 2016
1 parent 84c152a commit 059680f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Expand Up @@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//

// XFAIL: libcpp-no-exceptions
// <exception>

// class nested_exception;
Expand All @@ -17,6 +16,8 @@
#include <exception>
#include <cassert>

#include "test_macros.h"

class A
{
int data_;
Expand All @@ -34,6 +35,7 @@ int main()
e = e0;
assert(e.nested_ptr() == nullptr);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
try
{
Expand All @@ -57,4 +59,5 @@ int main()
}
}
}
#endif
}
Expand Up @@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//

// XFAIL: libcpp-no-exceptions
// <exception>

// class nested_exception;
Expand All @@ -17,6 +16,8 @@
#include <exception>
#include <cassert>

#include "test_macros.h"

class A
{
int data_;
Expand All @@ -33,6 +34,7 @@ int main()
std::nested_exception e = e0;
assert(e.nested_ptr() == nullptr);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
try
{
Expand All @@ -55,4 +57,5 @@ int main()
}
}
}
#endif
}
Expand Up @@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//

// XFAIL: libcpp-no-exceptions
// <exception>

// class nested_exception;
Expand All @@ -17,6 +16,8 @@
#include <exception>
#include <cassert>

#include "test_macros.h"

class A
{
int data_;
Expand All @@ -32,6 +33,7 @@ int main()
std::nested_exception e;
assert(e.nested_ptr() == nullptr);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
try
{
Expand All @@ -53,4 +55,5 @@ int main()
}
}
}
#endif
}

0 comments on commit 059680f

Please sign in to comment.