Changeset 5416b44
- Timestamp:
- May 27, 2022, 11:22:23 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 0a004b7
- Parents:
- c3b9d639
- Location:
- tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/nested_function.txt
rc3b9d639 r5416b44 1 j 3 3 2 j 2 2 3 j 2 2 4 j 2 2 5 j 1 1 6 j 1 1 7 j 1 1 8 j 1 1 9 j 1 1 10 j 1 1 11 j 1 1 12 j 1 1 13 j 1 1 14 j 1 1 15 j 1 1 16 j 1 1 17 j 0 0 18 j 0 0 19 j 0 0 20 i 22 22 21 j 3 3 22 j 2 2 23 j 2 2 24 j 2 2 25 j 1 1 26 j 1 1 27 j 1 1 28 j 1 1 29 j 1 1 30 j 1 1 31 j 1 1 32 j 1 1 33 j 1 1 34 j 1 1 35 j 1 1 36 j 1 1 37 j 0 0 38 j 0 0 39 j 0 0 40 i 22 22 41 j 3 3 42 j 2 2 43 j 2 2 44 j 2 2 45 j 1 1 46 j 1 1 47 j 1 1 48 j 1 1 49 j 1 1 50 j 1 1 51 j 1 1 52 j 1 1 53 j 1 1 54 j 1 1 55 j 1 1 56 j 1 1 57 j 0 0 58 j 0 0 59 j 0 0 60 i 22 22 61 j 3 3 62 j 2 2 63 j 2 2 64 j 2 2 65 j 1 1 66 j 1 1 67 j 1 1 68 j 1 1 69 j 1 1 70 j 1 1 71 j 1 1 72 j 1 1 73 j 1 1 74 j 1 1 75 j 1 1 76 j 1 1 77 j 0 0 78 j 0 0 79 j 0 0 80 i 22 22 81 j 3 3 82 j 2 2 83 j 2 2 84 j 2 2 85 j 1 1 86 j 1 1 87 j 1 1 88 j 1 1 89 j 1 1 90 j 1 1 91 j 1 1 92 j 1 1 93 j 1 1 94 j 1 1 95 j 1 1 96 j 1 1 97 j 0 0 98 j 0 0 99 j 0 0 100 i 22 22 1 total 105 -
tests/nested_function.cfa
rc3b9d639 r5416b44 1 //2 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo3 //4 // The contents of this file are covered under the licence agreement in the5 // file "LICENCE" distributed with Cforall.6 //7 // nested_function.cfa -- Test nested functions run on user-thread stacks.8 //9 // Author : Peter A. Buhr10 // Created On : Mon May 23 22:21:30 202211 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon May 23 23:11:25 202213 // Update Count : 414 //15 16 1 #include <thread.hfa> 17 2 #include <fstream.hfa> 18 3 #include <stdlib.hfa> 19 4 20 thread T {}; 5 enum { VALUES = 10_000 }; 6 int values[VALUES], total = 0; 21 7 22 enum { VALUES = 10_000 }; 23 int values[VALUES]; 8 thread T { int id; }; 24 9 25 10 void main( T & ) { 11 int sum = 0; 26 12 void f() { 27 13 int i = 0; … … 36 22 else h(); 37 23 i += 1; 38 s out | "j" | j | bsearchl( j, values, VALUES );// has internal nested compare routine24 sum += bsearchl( j, values, VALUES ); // has internal nested compare routine 39 25 } // h 40 26 h(); 41 sout | "i" | i | bsearchl( i, values, VALUES ); // has internal nested compare routine42 27 } // f 43 28 f(); 29 __atomic_fetch_add( &total, sum, __ATOMIC_SEQ_CST ); 44 30 } 45 31 int main() { 46 32 set_seed( 1003 ); 47 33 for ( i; VALUES ) values[i] = i; 48 T t[5]; 34 { 35 T t[5]; 36 } 37 sout | "total" | total; 49 38 }
Note: See TracChangeset
for help on using the changeset viewer.