source: src/tests/tupleCast.c @ 13e2c54

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 13e2c54 was 7933351, checked in by Rob Schluntz <rschlunt@…>, 8 years ago

add tuple cast resolution code

  • Property mode set to 100644
File size: 814 bytes
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// tupleCast.c --
8//
9// Author           : Rob Schluntz
10// Created On       : Mon Dec 12 15:56:07 2016
11// Last Modified By : Rob Schluntz
12// Last Modified On : Mon Dec 12 15:56:20 2016
13// Update Count     : 2
14//
15
16[char, int, double] f() { printf("ran f\n"); return ['c', 70, 6.28]; }
17
18int main() {
19  [int, char, float] x = [10, 'A', 3.14f];
20  printf("%d %c %g\n", ([int, char, float])x);
21  printf("%d %c\n", ([int, char])x);
22  printf("%d\n", ([int])x);
23  // printf("%d\n", (int)x);
24  printf("%g %g\n", ([double, float])x);
25  printf("%d %c\n", ([int, char])f());
26}
27
28// Local Variables: //
29// tab-width: 2 //
30// End: //
Note: See TracBrowser for help on using the repository browser.