File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 2
2
using namespace Halide ;
3
3
4
4
int main () {
5
- const Internal::Function func{};
6
- const Func f{func}; // internal_assert
5
+ #ifdef HALIDE_WITH_EXCEPTIONS
6
+ try {
7
+ #endif
8
+ const Internal::Function func{};
9
+ const Func f{func}; // internal_assert
7
10
8
- std::cout << f.name () << " \n " ; // segfaults without above assert
11
+ std::cout << f.name () << " \n " ; // segfaults without above assert
12
+ #ifdef HALIDE_WITH_EXCEPTIONS
13
+ } catch (const InternalError &e) {
14
+ // The harness rejects internal errors as they should typically not be
15
+ // _expected_. However, we are directly testing a constructor invariant
16
+ // check here, so an internal error is both expected and appropriate.
17
+ throw std::runtime_error (e.what ());
18
+ }
19
+ #endif
9
20
10
21
printf (" Success!\n " );
11
22
return 0 ;
You can’t perform that action at this time.
0 commit comments