X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftcon%2Ftest%2Fcompile_fail-wrap.c;fp=ccan%2Ftcon%2Ftest%2Fcompile_fail-wrap.c;h=26da13c3e0b9fe256a46acc21461d3f5e7b27dcf;hp=0000000000000000000000000000000000000000;hb=43992de4769085b3aba0fd9c167a85ad14e771d2;hpb=fced03d35c9fdf132f4405114f8d507716da1842 diff --git a/ccan/tcon/test/compile_fail-wrap.c b/ccan/tcon/test/compile_fail-wrap.c new file mode 100644 index 00000000..26da13c3 --- /dev/null +++ b/ccan/tcon/test/compile_fail-wrap.c @@ -0,0 +1,20 @@ +#include +#include + +struct container { + void *p; +}; + +int main(int argc, char *argv[]) +{ + TCON_WRAP(struct container, int *canary) icon; +#ifdef FAIL + char * +#else + int * +#endif + x = NULL; + + tcon_unwrap(tcon_check(&icon, canary, x))->p = x; + return 0; +}