Files
test/cpp/p.cpp
2021-03-25 08:17:48 -04:00

56 lines
898 B
C++

/* Check cf5-opt.vim defs.
VIM: let g:lcppflags="-O2 -pthread -D__USE_XOPEN2K8"
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
VIM: let g:cppflags=""
VIM: let g:ldflags=""
VIM: let g:ldlibpath=""
VIM: let g:argv=""
VIM-: let g:cf5output=0
*/
#include <iostream>
#include <exception>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
extern "C" {
#endif
int some_c_function_( int param1 );
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
}
#endif
int main ( void )
{try{
some_c_function_( 99 );
if (int i = 1)
std::cout << "lkkk" << i << std::endl;
return 0;
}
catch ( const std::exception& e )
{
std::cerr << std::endl
<< "std::exception(\"" << e.what() << "\")." << std::endl;
return 2;
}
catch ( ... )
{
std::cerr << std::endl
<< "unknown exception." << std::endl;
return 1;
}}