cmake/Tests/RunCMake/Android/android.cxx

49 lines
893 B
C++
Raw Normal View History

2016-10-30 18:24:19 +01:00
#include "android.h"
#ifndef STL_NONE
2018-08-09 18:06:22 +02:00
# include <cmath>
# include <cstdio>
# ifndef STL_SYSTEM
# include <exception>
# include <typeinfo>
# ifndef STL_STLPORT
# include <cxxabi.h>
# endif
# ifndef STL_GABI
# include <iostream>
# include <string>
# endif
# endif
2016-10-30 18:24:19 +01:00
#endif
int main()
{
#if !defined(STL_NONE)
// Require -lm implied by linking as C++.
std::printf("%p\n", static_cast<double (*)(double)>(&std::sin));
#endif
#if defined(STL_NONE)
return 0;
#elif defined(STL_SYSTEM)
return 0;
#else
try {
delete (new int);
} catch (std::exception const& e) {
2018-08-09 18:06:22 +02:00
# if defined(STL_GABI)
2016-10-30 18:24:19 +01:00
e.what();
typeid(e).name();
2018-08-09 18:06:22 +02:00
# else
2016-10-30 18:24:19 +01:00
std::cerr << e.what() << std::endl;
std::cerr << typeid(e).name() << std::endl;
2018-08-09 18:06:22 +02:00
# endif
2016-10-30 18:24:19 +01:00
}
2018-08-09 18:06:22 +02:00
# if defined(STL_GABI)
2016-10-30 18:24:19 +01:00
return 0;
2018-08-09 18:06:22 +02:00
# else
2016-10-30 18:24:19 +01:00
std::string s;
return static_cast<int>(s.size());
2018-08-09 18:06:22 +02:00
# endif
2016-10-30 18:24:19 +01:00
#endif
}