- Timestamp:
- Feb 1, 2020, 1:27:09 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 33a484f
- Parents:
- c334ecd
- Location:
- tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/expression.cfa
rc334ecd r948fdef 1 struct S { int i; }; 2 void ?{}( S & s, int i ) {} 3 int ?`mary( int ); 4 int ?`mary( S ); 5 [int] ?`mary( [int, int] ); 6 int jack( int ); 7 1 8 int main() { 2 struct s { int i; } x, *p = &x; 3 int i = 3; 9 int a[3] = { 0, 0, 0 }; 10 S s = { 3 }, * ps = &s; 11 [int] t; 12 * [int] pt = &t; 13 int i = 3, j = 4; 4 14 5 15 // operators … … 9 19 +i; 10 20 -i; 11 *p ;12 ++p ;13 --p ;14 p ++;15 p --;21 *ps; 22 ++ps; 23 --ps; 24 ps++; 25 ps--; 16 26 17 i+ i;18 i- i;19 i* i;27 i+j; 28 i-j; 29 i*j; 20 30 21 i/ i;22 i% i;23 i^ i;24 i& i;25 i| i;26 i< i;27 i> i;28 i= i;31 i/j; 32 i%j; 33 i^j; 34 i&j; 35 i|j; 36 i<j; 37 i>j; 38 i=j; 29 39 30 i==i; 31 i!=i; 32 i<<i; 33 i>>i; 34 i<=i; 35 i>=i; 36 i&&i; 37 i||i; 38 p->i; 39 i*=i; 40 i/=i; 41 i%=i; 42 i+=i; 43 i-=i; 44 i&=i; 45 i|=i; 46 i^=i; 47 i<<=i; 48 i>>=i; 40 i==j; 41 i!=j; 42 i<<j; 43 i>>j; 44 i<=j; 45 i>=j; 46 i&&j; 47 i||j; 48 ps->i; 49 49 50 i?i:i; 50 i*=j; 51 i/=j; 52 i%=j; 53 i+=j; 54 i-=j; 55 i&=j; 56 i|=j; 57 i^=j; 58 i<<=j; 59 i>>=j; 60 61 i?i:j; 62 63 // postfix function call 64 65 (3 + 4)`mary; 66 ({3 + 4;})`mary; 67 [3, 4]`mary; 68 3`mary; 69 a[0]`mary; 70 a[0]`mary`mary; 71 s{0}`mary; 72 jack(3)`mary; 73 s.i`mary; 74 t.0`mary; 75 s.[i]`mary; 76 ps->i`mary; 77 pt->0`mary; 78 ps->[i]`mary; 79 i++`mary; 80 i--`mary; 81 (S){2}`mary; 82 (S)@{2}`mary; 51 83 } // main -
tests/quotedKeyword.cfa
rc334ecd r948fdef 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 4 21:45:53 201813 // Update Count : 2 312 // Last Modified On : Sat Feb 1 00:02:22 2020 13 // Update Count : 24 14 14 // 15 15 … … 17 17 18 18 struct { 19 int ` otype`;20 int ` struct`;19 int ``otype``; 20 int ``struct``; 21 21 } st = { 10, 10 }; 22 22 23 typedef int ` forall`;24 ` forall` xxx = 10;23 typedef int ``forall``; 24 ``forall`` xxx = 10; 25 25 26 int ` _Alignas`, `_Alignof`, `__alignof`, `__alignof__`, `asm`, `__asm`, `__asm__`, `_At`, `_Atomic`, `__attribute`,27 ` __attribute__`, `auto`, `_Bool`, `break`, `case`, `catch`, `catchResume`, `char`, `choose`, `_Complex`, `__complex`,28 ` __complex__`, `const`, `__const`, `__const__`, `continue`, `default`, `disable`, `do`, `double`, `dtype`, `else`,29 ` enable`, `enum`, `__extension__`, `extern`, `fallthru`, `finally`, `float`, `__float128`, `for`, `forall`, `fortran`,30 ` ftype`, `_Generic`, `goto`, `if`, `_Imaginary`, `__imag`, `__imag__`, `inline`, `__inline`, `__inline__`, `int`,31 ` __int128`, `__label__`, `long`, `lvalue`, `_Noreturn`, `__builtin_offsetof`, `otype`, `register`, `restrict`,32 ` __restrict`, `__restrict__`, `return`, `short`, `signed`, `__signed`, `__signed__`, `sizeof`, `static`,33 ` _Static_assert`, `struct`, `switch`, `_Thread_local`, `throw`, `throwResume`, `trait`, `try`, `typedef`,34 ` typeof`, `__typeof`, `__typeof__`, `union`, `unsigned`, `__builtin_va_list`, `void`, `volatile`, `__volatile`,35 ` __volatile__`, `while`;26 int ``_Alignas``, ``_Alignof``, ``__alignof``, ``__alignof__``, ``asm``, ``__asm``, ``__asm__``, ``_At``, ``_Atomic``, ``__attribute``, 27 ``__attribute__``, ``auto``, ``_Bool``, ``break``, ``case``, ``catch``, ``catchResume``, ``char``, ``choose``, ``_Complex``, ``__complex``, 28 ``__complex__``, ``const``, ``__const``, ``__const__``, ``continue``, ``default``, ``disable``, ``do``, ``double``, ``dtype``, ``else``, 29 ``enable``, ``enum``, ``__extension__``, ``extern``, ``fallthru``, ``finally``, ``float``, ``__float128``, ``for``, ``forall``, ``fortran``, 30 ``ftype``, ``_Generic``, ``goto``, ``if``, ``_Imaginary``, ``__imag``, ``__imag__``, ``inline``, ``__inline``, ``__inline__``, ``int``, 31 ``__int128``, ``__label__``, ``long``, ``lvalue``, ``_Noreturn``, ``__builtin_offsetof``, ``otype``, ``register``, ``restrict``, 32 ``__restrict``, ``__restrict__``, ``return``, ``short``, ``signed``, ``__signed``, ``__signed__``, ``sizeof``, ``static``, 33 ``_Static_assert``, ``struct``, ``switch``, ``_Thread_local``, ``throw``, ``throwResume``, ``trait``, ``try``, ``typedef``, 34 ``typeof``, ``__typeof``, ``__typeof__``, ``union``, ``unsigned``, ``__builtin_va_list``, ``void``, ``volatile``, ``__volatile``, 35 ``__volatile__``, ``while``; 36 36 37 37 int main() { 38 int ` if` = 0;39 ` catch` = 1;40 st.` otype` = 2;41 st.` struct` = 3;42 ` throw` = 4;43 sout | ` catch` + st.`otype` + st.`struct` + `throw`;38 int ``if`` = 0; 39 ``catch`` = 1; 40 st.``otype`` = 2; 41 st.``struct`` = 3; 42 ``throw`` = 4; 43 sout | ``catch`` + st.``otype`` + st.``struct`` + ``throw``; 44 44 } 45 45
Note: See TracChangeset
for help on using the changeset viewer.