ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change
on this file since 58fe85a 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
|
Rev | Line | |
---|
[afe2939] | 1 | // Create monomorphic instances of polymorphic types at global scope. |
---|
[74cfafb2] | 2 | |
---|
| 3 | forall(dtype T) |
---|
| 4 | void poly0(T &) {} |
---|
| 5 | |
---|
| 6 | forall(dtype T | sized(T)) |
---|
| 7 | void poly1(T &) {} |
---|
| 8 | |
---|
| 9 | forall(otype T) |
---|
| 10 | void poly2(T &) {} |
---|
| 11 | |
---|
| 12 | struct wrapper { |
---|
| 13 | void (*mono)(int &); |
---|
| 14 | }; |
---|
| 15 | |
---|
| 16 | /* These are failing (#193): |
---|
| 17 | void (*mono0)(int &) = poly0; |
---|
| 18 | void (*mono1)(int &) = poly1; |
---|
| 19 | void (*mono2)(int &) = poly2; |
---|
| 20 | struct wrapper mono0w = { poly0 }; |
---|
| 21 | struct wrapper mono1w = { poly1 }; |
---|
| 22 | struct wrapper mono2w = { poly2 }; |
---|
| 23 | */ |
---|
| 24 | void (*mono0c)(int &) @= poly0; |
---|
| 25 | void (*mono1c)(int &) @= poly1; |
---|
| 26 | void (*mono2c)(int &) @= poly2; |
---|
| 27 | struct wrapper mono0wc @= { poly0 }; |
---|
| 28 | struct wrapper mono1wc @= { poly1 }; |
---|
| 29 | struct wrapper mono2wc @= { poly2 }; |
---|
| 30 | |
---|
| 31 | int main(void) { |
---|
| 32 | printf("Compilation Successful.\n"); |
---|
| 33 | return 0; |
---|
| 34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.