]> git.ozlabs.org Git - ccan/blobdiff - ccan/compiler/test/run-is_compile_constant.c
compiler: header for compiler-specific wrappers.
[ccan] / ccan / compiler / test / run-is_compile_constant.c
diff --git a/ccan/compiler/test/run-is_compile_constant.c b/ccan/compiler/test/run-is_compile_constant.c
new file mode 100644 (file)
index 0000000..0a15280
--- /dev/null
@@ -0,0 +1,15 @@
+#include <ccan/compiler/compiler.h>
+#include <ccan/tap/tap.h>
+
+int main(int argc, char *argv[])
+{
+       plan_tests(2);
+
+       ok1(!IS_COMPILE_CONSTANT(argc));
+#ifdef HAVE_BUILTIN_CONSTANT_P
+       ok1(IS_COMPILE_CONSTANT(7));
+#else
+       pass("If !HAVE_BUILTIN_CONSTANT_P, IS_COMPILE_CONSTANT always false");
+#endif
+       return exit_status();
+}