aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/preprocessor
diff options
Diffstat (limited to 'validation/preprocessor')
-rw-r--r--validation/preprocessor/predef-char-bit.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/validation/preprocessor/predef-char-bit.c b/validation/preprocessor/predef-char-bit.c
new file mode 100644
index 00000000..fed0166e
--- /dev/null
+++ b/validation/preprocessor/predef-char-bit.c
@@ -0,0 +1,16 @@
+#define TEST_BIT(X, T) if (__ ## X ## _BIT__ != 8 * sizeof(T)) return 1
+
+int test(void)
+{
+ TEST_BIT(CHAR, char);
+
+ return 0;
+}
+
+/*
+ * check-name: predefined __<type>_BIT__
+ * check-command: test-linearize -Wno-decl $file
+ * check-output-ignore
+ *
+ * check-output-contains: ret\\..*\\$0
+ */