Add support for "switch" statements.
Switches with both uniform and varying "switch" expressions are supported. Switch statements with varying expressions and very large numbers of labels may not perform well; some issues to be filed shortly will track opportunities for improving these.
This commit is contained in:
13
tests_errors/switch-3.ispc
Normal file
13
tests_errors/switch-3.ispc
Normal file
@@ -0,0 +1,13 @@
|
||||
// "case" label illegal outside of "switch" statement
|
||||
|
||||
void foo(float f) {
|
||||
switch (f) {
|
||||
case 1:
|
||||
++f;
|
||||
case 2:
|
||||
f = 0;
|
||||
}
|
||||
case 3:
|
||||
--f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user