Changeset dafbde8 for tests/tuple


Ignore:
Timestamp:
Jan 20, 2021, 4:49:40 PM (12 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
454f478
Parents:
92bfda0 (diff), fd54fef (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
tests/tuple
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/tuple/tuplePolymorphism.cfa

    r92bfda0 rdafbde8  
    2929// ensure that f is a viable candidate for g, even though its parameter structure does not exactly match
    3030[A] f([A, B] x, B y) { printf("%g %c %g %lld %c %lld %lld %c %lld\n", x.0.[x,y,z], x.1.[x,y,z], y.[x,y,z]); return x.0; }
    31 forall(otype T, otype U | { T f(T, U, U); })
     31forall(T, U | { T f(T, U, U); })
    3232void g(T x, U y) { f(x, y, y); }
    3333
    3434// add two triples
    35 forall(otype T | { T ?+?(T, T); })
     35forall(T | { T ?+?(T, T); })
    3636[T, T, T] ?+?([T, T, T] x, [T, T, T] y) {
    3737        return [x.0+y.0, x.1+y.1, x.2+y.2];
     
    6464}
    6565
    66 forall(otype T)
     66forall(T)
    6767[T, T] foo([T, T] y) {
    6868        [T, T] x;
  • tests/tuple/tupleVariadic.cfa

    r92bfda0 rdafbde8  
    1919        printf("called func(void)\n");
    2020}
    21 forall(otype T, ttype Params | { void process(T); void func(Params); })
     21forall(T, Params... | { void process(T); void func(Params); })
    2222void func(T arg1, Params p) {
    2323        process(arg1);
     
    9292}
    9393
    94 forall(otype T)
     94forall(T)
    9595T * copy(T x) {
    9696        // test calling new inside a polymorphic function
     
    9898}
    9999
    100 forall(ttype T | { void foo(T); }) void bar(T x) {}
     100forall(T... | { void foo(T); }) void bar(T x) {}
    101101void foo(int) {}
    102102
Note: See TracChangeset for help on using the changeset viewer.