From 0bd7672c3d4af8d90741316189456ec897b5a4b2 Mon Sep 17 00:00:00 2001 From: Chris Diamand Date: Fri, 27 Feb 2015 01:12:10 +0000 Subject: [PATCH] Updated tests/examples. --- .gitignore | 1 + test/allocs.c | 7 +++++++ test/types.c | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/allocs.c diff --git a/.gitignore b/.gitignore index 965ac26..71b4132 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.fixuplog *.i *.i.allocs +*.ll *.log *.o *.pyc diff --git a/test/allocs.c b/test/allocs.c new file mode 100644 index 0000000..46671ea --- /dev/null +++ b/test/allocs.c @@ -0,0 +1,7 @@ +#include + +int main(void) { + int *x = malloc(sizeof(int) * 3); + long *lp = (long *) x; + return 0; +} diff --git a/test/types.c b/test/types.c index c5b9d66..70611d2 100644 --- a/test/types.c +++ b/test/types.c @@ -3,9 +3,10 @@ struct foo; typedef void (*fun_t)(int); +typedef double *(*fun2_t)(short, long); int main(void) { - void *p = NULL; + double *p = NULL; int *i = (int *) p; long **lp = (long **) p; void **pp = (void **) p; @@ -13,6 +14,7 @@ int main(void) { struct foo **sfpp = (struct foo **) p; struct foo ***sfppp = (struct foo ***) p; fun_t x = (fun_t) p; + fun2_t x2 = (fun2_t) p; return 0; }