Changeset d5b2ac8 for tests/genericUnion.cfa
- Timestamp:
- Dec 26, 2018, 7:21:08 AM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 0689cd9, 25cdca5
- Parents:
- f498c51
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/genericUnion.cfa
rf498c51 rd5b2ac8 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2016 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 // genericUnion.cfa -- 8 // 9 // Author : Peter A. Buhr 10 // Created On : Tue Dec 25 14:42:46 2018 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 25 14:46:33 2018 13 // Update Count : 2 14 // 15 1 16 #include <limits.hfa> 2 17 … … 4 19 union ByteView { 5 20 T val; 6 char bytes[(sizeof(int))]; 21 char bytes[(sizeof(int))]; // want to change to sizeof(T) 7 22 }; 8 23 9 24 forall(otype T) 10 25 void print(ByteView(T) x) { 11 for (int i = 0; i < sizeof(int); i++) { 26 for (int i = 0; i < sizeof(int); i++) { // want to change to sizeof(T) 12 27 printf("%02x", x.bytes[i] & 0xff); 13 28 } … … 29 44 f(i, -1); 30 45 } 46 47 // Local Variables: // 48 // tab-width: 4 // 49 // compile-command: "cfa genericUnion.cfa" // 50 // End: //
Note: See TracChangeset
for help on using the changeset viewer.