mirror of
https://github.com/usatiuk/ficus.git
synced 2025-10-28 16:17:51 +01:00
C++ exceptions test
This commit is contained in:
7
clionenv.sh
Normal file
7
clionenv.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# FIXME:
|
||||
export PREFIX="/Users/stepus53/projects/os2/toolchain/gcc-x86_64-os3-prefix/"
|
||||
export TARGET=x86_64-os3
|
||||
export PATH="$PREFIX/bin:$PATH"
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
#include <iostream>
|
||||
|
||||
void badfn() {
|
||||
throw std::runtime_error("oops");
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::cout << "Hi!" << std::endl;
|
||||
std::cout << "hi" << std::endl;
|
||||
try {
|
||||
std::cout << "try" << std::endl;
|
||||
badfn();
|
||||
std::cout << "ok" << std::endl;
|
||||
} catch (std::exception &e) {
|
||||
std::cout << "huh" << std::endl;
|
||||
std::cout << e.what() << std::endl;
|
||||
}
|
||||
std::cout << "fin" << std::endl;
|
||||
}
|
||||
Reference in New Issue
Block a user