X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftcon%2Ftest%2Fcompile_ok.c;fp=ccan%2Ftcon%2Ftest%2Fcompile_ok.c;h=447f0ee50a02b739fa45e2cb18f4c34e52e652e4;hp=0000000000000000000000000000000000000000;hb=5c451bbbed80e3bcb1f6be4301026ece01ab1309;hpb=37965b33eeb202773dc70c4546d0b050b8e717b5 diff --git a/ccan/tcon/test/compile_ok.c b/ccan/tcon/test/compile_ok.c new file mode 100644 index 00000000..447f0ee5 --- /dev/null +++ b/ccan/tcon/test/compile_ok.c @@ -0,0 +1,27 @@ +#include +#include + +struct container { + void *p; +}; + +struct int_container { + struct container raw; + TCON(int tc); +}; + +struct charp_and_int_container { + struct container raw; + TCON(int tc1; char *tc2); +}; + +int main(int argc, char *argv[]) +{ + struct int_container icon; + struct charp_and_int_container cicon; + + tcon_check(&icon, tc, 7)->raw.p = NULL; + tcon_check(&cicon, tc1, 7)->raw.p = argv[0]; + tcon_check(&cicon, tc2, argv[0])->raw.p = argv[0]; + return 0; +}