libstdc++-v3/testsuite/abi/pr42230.cc
raw| 1 | // { dg-do run } |
| 2 | // { dg-require-effective-target hosted } |
| 3 | |
| 4 | #include <cxxabi.h> |
| 5 | #include <cassert> |
| 6 | #include <cstddef> |
| 7 | #include <cstdlib> |
| 8 | |
| 9 | int main() |
| 10 | { |
| 11 | std::size_t length = 0; |
| 12 | int cc; |
| 13 | |
| 14 | char* ret = abi::__cxa_demangle("e", 0, &length, &cc); |
| 15 | |
| 16 | assert( (cc < 0 && !ret) || (ret && length) ); |
| 17 | std::free(ret); |
| 18 | return 0; |
| 19 | } |