- Timestamp:
- Nov 28, 2017, 3:52:06 PM (8 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:
- 383e159, 8d5b9cf
- Parents:
- cf966b5 (diff), 8a0a64d9 (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:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/Makefile.am
rcf966b5 r6c2ba38 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Tue Oct 10 14:04:40201714 ## Update Count : 4 713 ## Last Modified On : Mon Nov 27 21:34:33 2017 14 ## Update Count : 48 15 15 ############################################################################### 16 16 … … 118 118 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 119 119 120 functions: functions.c @CFA_BINDIR@/@CFA_NAME@ 121 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 122 120 123 KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@ 121 124 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} -
src/tests/Makefile.in
rcf966b5 r6c2ba38 871 871 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 872 872 873 functions: functions.c @CFA_BINDIR@/@CFA_NAME@ 874 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 875 873 876 KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@ 874 877 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} -
src/tests/designations.c
rcf966b5 r6c2ba38 17 17 // In particular, since the syntax for designations in Cforall differs from that of C, preprocessor substitution 18 18 // is used for the designation syntax 19 #ifdef __ CFORALL__19 #ifdef __cforall 20 20 #define DES : 21 21 #else -
src/tests/functions.c
rcf966b5 r6c2ba38 10 10 // Created On : Wed Aug 17 08:39:58 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 08:40:52 201613 // Update Count : 1 12 // Last Modified On : Mon Nov 27 18:08:54 2017 13 // Update Count : 11 14 14 // 15 15 … … 66 66 // Cforall extensions 67 67 68 [] f( );68 // [] f( ); 69 69 [int] f( ); 70 [] f(int);70 // [] f(int); 71 71 [int] f(int); 72 [] f( ) {}72 // [] f( ) {} 73 73 [int] f( ) {} 74 [] f(int) {}74 // [] f(int) {} 75 75 [int] f(int) {} 76 76 77 77 [int x] f( ); 78 [] f(int x);79 [int x] f(int x);80 [int x] f( ) {}81 [] f(int x) {}82 [int x] f(int x) {}78 // [] f(int x); 79 //[int x] f(int x); 80 //[int x] f( ) {} 81 // [] f(int x) {} 82 //[int x] f(int x) {} 83 83 84 84 [int, int x] f( ); 85 [] f(int, int x);85 // [] f(int, int x); 86 86 [int, int x] f(int, int x); 87 87 [int, int x] f( ) {} 88 [] f(int, int x) {}88 // [] f(int, int x) {} 89 89 [int, int x] f(int, int x) {} 90 90 91 91 [int, int x, int] f( ); 92 [] f(int, int x, int);92 // [] f(int, int x, int); 93 93 [int, int x, int] f(int, int x, int); 94 94 [int, int x, int] f( ) {} 95 [] f(int, int x, int) {}95 // [] f(int, int x, int) {} 96 96 [int, int x, int] f(int, int x, int) {} 97 97 98 98 [int, int x, * int y] f( ); 99 [] f(int, int x, * int y);99 // [] f(int, int x, * int y); 100 100 [int, int x, * int y] f(int, int x, * int y); 101 101 [int, int x, * int y] f( ) {} 102 [] f(int, int x, * int y) {}102 // [] f(int, int x, * int y) {} 103 103 [int, int x, * int y] f(int, int x, * int y) {} 104 104 105 [ int ] f11( int ), f12; // => int f11( int ), f12( int ); 105 // function prototypes 106 107 [ int ] f11( int ), f12(); // => int f11( int ), f12( void ); 108 109 const double bar1(), bar2( int ), bar3( double ); // C version 110 [const double] foo(), foo( int ), foo( double ) { return 3.0; } // CFA version 111 struct S { int i; }; 112 [S] rtn( int ) {} 113 106 114 107 115 [int] f( … … 109 117 [int](int) 110 118 ) { 111 int (*(*p )[][10])[][3];119 int (*(*pc)[][10])[][3]; 112 120 * [][10] * [][3] int p; 113 121 * [] * [int](int) p; -
src/tests/polymorphism.c
rcf966b5 r6c2ba38 47 47 S s; 48 48 s.i = i; 49 assert (s.i == i);49 assertf(s.i == i, "struct operation fails in polymorphic context."); 50 50 51 51 B b; … … 73 73 { 74 74 // test aggregates with polymorphic members 75 typedef uint32_t x_type;76 typedef uint64_t y_type;75 typedef __attribute__((aligned(8))) uint32_t x_type; 76 typedef __attribute__((aligned(8))) uint64_t y_type; 77 77 78 78 x_type x = 3; … … 89 89 // ensure that the size of aggregates with polymorphic members 90 90 // matches the size of the aggregates in a monomorphic context 91 assert( struct_size(x, y) == sizeof(S) ); 92 assert( union_size(x, y) == sizeof(U) ); 91 size_t ssz = struct_size(x, y); 92 size_t usz = union_size(x, y); 93 assertf( ssz == sizeof(S), "struct size differs in polymorphic context: %zd / %zd", ssz, sizeof(S)); 94 assertf( usz == sizeof(U), "union size differs in polymorphic context: %zd / %zd", usz, sizeof(U)); 93 95 94 96 y_type ?=?(y_type & this, zero_t) { … … 111 113 u.f2 = 0; 112 114 u.f1 = x; 113 assert (ret == u.f2);115 assertf(ret == u.f2, "union operation fails in polymorphic context."); 114 116 } 115 117 }
Note:
See TracChangeset
for help on using the changeset viewer.