yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

sadd amr3eavoid undefined shifts and signed overflow in #if expression operatorsbf8193c0

main
933 B27 linesraw
1#if (1 << 100) != 0
2#error shifting left by more than the width should yield 0, something went wrong.
3#endif
4#if (1 >> 100) != 0
5#error shifting right by more than the width should yield 0, something went wrong.
6#endif
7#if (-1 >> 100) != -1
8#error shifting a negative right by more than the width should sign fill, something went wrong.
9#endif
10#if (1 << -1) != 0
11#error shifting left by a negative amount should yield 0, something went wrong.
12#endif
13#if (1 >> -1) != 0
14#error shifting right by a negative amount should yield 0, something went wrong.
15#endif
16#if (-1 << 1) != -2
17#error shifting a negative left should wrap, something went wrong.
18#endif
19#if (2147483647 + 1) != -2147483648
20#error addition should wrap, something went wrong.
21#endif
22#if (-2147483648 - 1) != 2147483647
23#error subtraction should wrap, something went wrong.
24#endif
25#if (2147483647 * 2) != -2
26#error multiplication should wrap, something went wrong.
27#endif