X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcompiler%2Ftest%2Frun-is_compile_constant.c;fp=ccan%2Fcompiler%2Ftest%2Frun-is_compile_constant.c;h=0a15280b61635db92b782aa1eea01f7ed91b2aa3;hb=89f1301ed2b65cdb4730bb28c42428873a69faec;hp=0000000000000000000000000000000000000000;hpb=a8e0cfb1b02bd89850540f60232fc52fb0a11500;p=ccan diff --git a/ccan/compiler/test/run-is_compile_constant.c b/ccan/compiler/test/run-is_compile_constant.c new file mode 100644 index 00000000..0a15280b --- /dev/null +++ b/ccan/compiler/test/run-is_compile_constant.c @@ -0,0 +1,15 @@ +#include +#include + +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(); +}