]> git.ozlabs.org Git - ccan/blob - ccan/tcon/test/compile_ok.c
Remove travis workarounds for previous build system
[ccan] / ccan / tcon / test / compile_ok.c
1 #include <ccan/tcon/tcon.h>
2 #include <ccan/build_assert/build_assert.h>
3 #include <stdlib.h>
4
5 struct container {
6         void *p;
7 };
8
9 struct int_container {
10         struct container raw;
11         TCON(int tc);
12 };
13
14 struct charp_and_int_container {
15         struct container raw;
16         TCON(int tc1; char *tc2);
17 };
18
19 int main(int argc, char *argv[])
20 {
21         struct int_container icon;
22         struct charp_and_int_container cicon;
23         TCON_WRAP(struct container, int tc) iconw;
24         TCON_WRAP(struct container, int tc1; char *tc2) ciconw;
25
26         tcon_check(&icon, tc, 7)->raw.p = NULL;
27         tcon_check(&cicon, tc1, 7)->raw.p = argv[0];
28         tcon_check(&cicon, tc2, argv[0])->raw.p = argv[0];
29
30         tcon_unwrap(tcon_check(&iconw, tc, 7))->p = NULL;
31         tcon_unwrap(tcon_check(&ciconw, tc1, 7))->p = argv[0];
32         tcon_unwrap(tcon_check(&ciconw, tc2, argv[0]))->p = argv[0];
33
34         BUILD_ASSERT(sizeof(iconw) == sizeof(struct container));
35         BUILD_ASSERT(sizeof(ciconw) == sizeof(struct container));
36
37         return 0;
38 }