source: tests/global-monomorph.cfa @ f6eaff2

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since f6eaff2 was afe2939, checked in by Andrew Beach <ajbeach@…>, 4 years ago

Removed #include <stdio.h> from tests that only use printf.

  • Property mode set to 100644
File size: 739 bytes
Line 
1// Create monomorphic instances of polymorphic types at global scope.
2
3forall(dtype T)
4void poly0(T &) {}
5
6forall(dtype T | sized(T))
7void poly1(T &) {}
8
9forall(otype T)
10void poly2(T &) {}
11
12struct wrapper {
13    void (*mono)(int &);
14};
15
16/* These are failing (#193):
17void (*mono0)(int &) = poly0;
18void (*mono1)(int &) = poly1;
19void (*mono2)(int &) = poly2;
20struct wrapper mono0w = { poly0 };
21struct wrapper mono1w = { poly1 };
22struct wrapper mono2w = { poly2 };
23*/
24void (*mono0c)(int &) @= poly0;
25void (*mono1c)(int &) @= poly1;
26void (*mono2c)(int &) @= poly2;
27struct wrapper mono0wc @= { poly0 };
28struct wrapper mono1wc @= { poly1 };
29struct wrapper mono2wc @= { poly2 };
30
31int main(void) {
32        printf("Compilation Successful.\n");
33        return 0;
34}
Note: See TracBrowser for help on using the repository browser.