X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fminmax%2Ftest%2Fcompile_fail-wrongsize.c;fp=ccan%2Fminmax%2Ftest%2Fcompile_fail-wrongsize.c;h=ef57784ff598720c32666deb28c2a25de51792df;hp=0000000000000000000000000000000000000000;hb=e8fe775b03a9abde11f7ce7a9ebf8e002111e923;hpb=930753e727859171d37f2e51d129f2e42ecf1dfa diff --git a/ccan/minmax/test/compile_fail-wrongsize.c b/ccan/minmax/test/compile_fail-wrongsize.c new file mode 100644 index 00000000..ef57784f --- /dev/null +++ b/ccan/minmax/test/compile_fail-wrongsize.c @@ -0,0 +1,19 @@ +#include + +static int function(void) +{ +#ifdef FAIL + return min(1, 1L); +#if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P +#error "Unfortunately we don't fail if the typechecks are noops." +#endif +#else + return 0; +#endif +} + +int main(int argc, char *argv[]) +{ + function(); + return 0; +}