Add initial support for 'goto' statements.
ispc now supports goto, but only under uniform control flow--i.e. it must be possible for the compiler to statically determine that all program instances will follow the goto. An error is issued at compile time if a goto is used when this is not the case.
This commit is contained in:
11
tests_errors/goto-3.ispc
Normal file
11
tests_errors/goto-3.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
// "goto" statements are only legal under "uniform" control flow
|
||||
|
||||
void func(int x) {
|
||||
cif (x < 0)
|
||||
goto label;
|
||||
|
||||
label:
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user