source: src/tests/tupleCast.c @ fc638d2

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since fc638d2 was f7e749f, checked in by Rob Schluntz <rschlunt@…>, 5 years ago

added tests for polymorphic tuples and cast on tuples, updated a couple of other tests

  • Property mode set to 100644
File size: 757 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("%g %g\n", ([double, float])x);
23  printf("%d %c\n", ([int, char])f());
24}
25
26// Local Variables: //
27// tab-width: 2 //
28// End: //
Note: See TracBrowser for help on using the repository browser.