aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
Diffstat (limited to 'validation')
-rw-r--r--validation/preprocessor/predef-max.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/validation/preprocessor/predef-max.c b/validation/preprocessor/predef-max.c
new file mode 100644
index 00000000..ad4b7eaf
--- /dev/null
+++ b/validation/preprocessor/predef-max.c
@@ -0,0 +1,18 @@
+#define TEST_MAX(X, Z) if (X != ((~ Z) >> 1)) return 1
+
+int test_max(void)
+{
+ TEST_MAX(__INT_MAX__, 0U);
+ TEST_MAX(__LONG_MAX__, 0UL);
+ TEST_MAX(__LONG_LONG_MAX__, 0ULL);
+
+ return 0;
+}
+
+/*
+ * check-name: predefined __<type>_MAX__
+ * check-command: test-linearize -Wno-decl $file
+ * check-output-ignore
+ *
+ * check-output-contains: ret\\..*\\$0
+ */