Merge pull request #2524 from kugelfuhr/kugelfuhr/fix-2523

Fix some issues with preprocessor expressions
This commit is contained in:
Bob Andrews
2024-10-05 14:14:29 +02:00
committed by GitHub
3 changed files with 39 additions and 24 deletions

29
test/val/bug2523.c Normal file
View File

@@ -0,0 +1,29 @@
#if (0u - 1) < 0
#error
#endif
#if !1u - 1 > 0
#error
#endif
#if (1 & 1u) - 2 < 0
#error
#endif
#if (1 | 1u) - 2 < 0
#error
#endif
#if (1 ^ 1u) - 2 < 0
#error
#endif
#if (1u >> 1) - 2 < 0
#error
#endif
#if (0u << 1) - 1 < 0
#error
#endif
int main() { return 0; }