skia2/tests/sksl/errors/SwitchDuplicateDefault.glsl
John Stiles 463fad21ba Add test for duplicate default switch-case.
Surprisingly, this error is actually caught by our parser, which
interprets the default label in a unique way. From the parser comments:

  "Requiring default: to be last (in defiance of C and GLSL) was a
   deliberate decision. Other parts of the compiler may rely upon this
   assumption."

The comment is true--we don't check for duplicate default switch-case
labels anywhere else in the code, just here in the parser.

We rely on this, so we should have a test for it.

Change-Id: I6df5c565aca4d4b8565b96638dce9504efc39ccc
Bug: skia:11340
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372617
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-02-19 20:31:50 +00:00

5 lines
84 B
GLSL

### Compilation failed:
error: 4: expected expression, but found 'default'
1 error