source: tests/tuple/tupleCast.cfa @ f403c46

ADTast-experimentalpthread-emulation
Last change on this file since f403c46 was 107b01a, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Several changes to the makefiles

  • change .c tests to .cfa
  • add require for libtool in configure
  • libtoolize to fix some warnings
  • 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.