- Timestamp:
- Nov 22, 2017, 5:06:06 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 8dceeb7
- Parents:
- f203a7a (diff), 4d5e57b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/tests
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/completeTypeError.txt
rf203a7a r1ba5803 1 completeTypeError.c:3 4:1 error: No reasonable alternatives for expression Applying untyped:1 completeTypeError.c:33:1 error: No reasonable alternatives for expression Applying untyped: 2 2 Name: *? 3 3 ...to: 4 4 Name: v 5 5 6 completeTypeError.c:34:1 error: No reasonable alternatives for expression Applying untyped: 7 Name: *? 8 ...to: 9 Name: y 10 11 completeTypeError.c:35:1 error: No reasonable alternatives for expression Applying untyped: 12 Name: foo 13 ...to: 14 Name: v 6 15 7 16 completeTypeError.c:36:1 error: No reasonable alternatives for expression Applying untyped: … … 10 19 Name: v 11 20 12 13 21 completeTypeError.c:37:1 error: No reasonable alternatives for expression Applying untyped: 14 22 Name: quux 15 23 ...to: 16 24 Name: v 17 18 25 19 26 completeTypeError.c:58:1 error: No reasonable alternatives for expression Applying untyped: … … 22 29 Name: y 23 30 24 25 31 completeTypeError.c:59:1 error: No reasonable alternatives for expression Applying untyped: 26 32 Name: quux 27 33 ...to: 28 34 Name: y 29 30 35 31 36 completeTypeError.c:60:1 error: No reasonable alternatives for expression Applying untyped: … … 34 39 Name: y 35 40 36 37 41 completeTypeError.c:72:1 error: No reasonable alternatives for expression Applying untyped: 38 42 Name: baz … … 40 44 Name: z 41 45 42 -
src/tests/Makefile.am
rf203a7a r1ba5803 141 141 typedefRedef-ERR1: typedefRedef.c @CFA_BINDIR@/@CFA_NAME@ 142 142 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 143 144 alloc-ERROR: alloc.c @CFA_BINDIR@/@CFA_NAME@ 145 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} -
src/tests/Makefile.in
rf203a7a r1ba5803 895 895 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 896 896 897 alloc-ERROR: alloc.c @CFA_BINDIR@/@CFA_NAME@ 898 ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@} 899 897 900 # Tell versions [3.59,3.63) of GNU make to not export all variables. 898 901 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/tests/alloc.c
rf203a7a r1ba5803 32 32 // allocation, non-array types 33 33 34 p = ( void *)malloc( sizeof(*p) ); // C malloc, type unsafe34 p = (int *)(void *)malloc( sizeof(*p) ); // C malloc, type unsafe 35 35 *p = 0xdeadbeef; 36 36 printf( "C malloc %#x\n", *p ); … … 54 54 printf( "\n" ); 55 55 56 p = calloc( dim, sizeof( *p ) ); // C array calloc, type unsafe56 p = (int *)calloc( dim, sizeof( *p ) ); // C array calloc, type unsafe 57 57 printf( "C array calloc, fill 0\n" ); 58 58 for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); } … … 83 83 printf( "\n" ); 84 84 85 p = ( void *)realloc( p, dim * sizeof(*p) ); // C realloc85 p = (int *)(void *)realloc( p, dim * sizeof(*p) ); // C realloc 86 86 for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; } 87 87 printf( "C realloc\n" ); … … 256 256 stp = malloc(); 257 257 printf( "\nSHOULD FAIL\n" ); 258 #ifdef ERR1 258 259 p = alloc( stp, dim * sizeof(*stp) ); 259 260 p = memset( stp, 10 ); 260 261 p = memcpy( &st1, &st ); 262 #endif 261 263 } // main 262 264 -
src/tests/completeTypeError.c
rf203a7a r1ba5803 12 12 void *v; 13 13 14 //A * x;15 //A * y;16 //B * x;17 //B * z;14 A * x; 15 A * y; 16 B * x; 17 B * z; 18 18 19 19 // okay 20 20 *i; 21 //*x; // picks B22 //*z;21 *x; // picks B 22 *z; 23 23 foo(i); 24 24 bar(i); … … 29 29 bar(v); 30 30 qux(v); 31 foo(v); // questionable, but works at the moment for C compatibility32 31 33 32 // bad 34 33 *v; 35 // *y; 34 *y; 35 foo(v); 36 36 baz(v); 37 37 quux(v); -
src/tests/dtor-early-exit.c
rf203a7a r1ba5803 22 22 23 23 struct A { 24 c har * name;24 const char * name; 25 25 int * x; 26 26 }; -
src/tests/init_once.c
rf203a7a r1ba5803 72 72 insert( &constructed, &x ); 73 73 74 x.x = malloc(sizeof(int));74 x.x = (int *)malloc(sizeof(int)); 75 75 } 76 76 -
src/tests/multiDimension.c
rf203a7a r1ba5803 7 7 printf("default constructing\n"); 8 8 (this.a){ 123 }; 9 this.ptr = malloc(sizeof(int));9 this.ptr = (int *)malloc(sizeof(int)); 10 10 } 11 11 … … 13 13 printf("copy constructing\n"); 14 14 (this.a){ other.a }; 15 this.ptr = malloc(sizeof(int));15 this.ptr = (int *)malloc(sizeof(int)); 16 16 } 17 17 … … 19 19 printf("constructing with %d\n", a); 20 20 (this.a){ a }; 21 this.ptr = malloc(sizeof(int));21 this.ptr = (int *)malloc(sizeof(int)); 22 22 } 23 23 -
src/tests/tupleVariadic.c
rf203a7a r1ba5803 73 73 [a0, a1, a2, a3] = args; 74 74 a.size = 4; 75 a.data = malloc(sizeof(int)*a.size);75 a.data = (int *)malloc(sizeof(int)*a.size); 76 76 a.data[0] = a0; 77 77 a.data[1] = a1; -
src/tests/vector/vector_int.c
rf203a7a r1ba5803 27 27 vec.last = -1; 28 28 vec.capacity = reserve; 29 vec.data = malloc( sizeof( int ) * reserve );29 vec.data = (int *)malloc( sizeof( int ) * reserve ); 30 30 } 31 31 … … 33 33 vec.last = other.last; 34 34 vec.capacity = other.capacity; 35 vec.data = malloc( sizeof( int ) * other.capacity );35 vec.data = (int *)malloc( sizeof( int ) * other.capacity ); 36 36 for (int i = 0; i < vec.last; i++) { 37 37 vec.data[i] = other.data[i]; … … 45 45 void reserve( vector_int *vec, int reserve ) { 46 46 if ( reserve > vec->capacity ) { 47 vec->data = realloc( vec->data, sizeof( int ) * reserve );47 vec->data = (int *)realloc( vec->data, sizeof( int ) * reserve ); 48 48 vec->capacity = reserve; 49 49 } … … 54 54 if ( vec->last == vec->capacity ) { 55 55 vec->capacity *= 2; 56 vec->data = realloc( vec->data, sizeof( int ) * vec->capacity );56 vec->data = (int *)realloc( vec->data, sizeof( int ) * vec->capacity ); 57 57 } 58 58 vec->data[ vec->last ] = element;
Note: See TracChangeset
for help on using the changeset viewer.