Skip to content

Commit

Permalink
Updated tests/examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdiamand committed Feb 27, 2015
1 parent 05c627d commit 0bd7672
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.fixuplog
*.i
*.i.allocs
*.ll
*.log
*.o
*.pyc
Expand Down
7 changes: 7 additions & 0 deletions test/allocs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdlib.h>

int main(void) {
int *x = malloc(sizeof(int) * 3);
long *lp = (long *) x;
return 0;
}
4 changes: 3 additions & 1 deletion test/types.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
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;
struct foo *sfp = (struct foo *) p;
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;
}

0 comments on commit 0bd7672

Please sign in to comment.