Last change
on this file since b6f2e7ab was
8da3cc4d,
checked in by Michael Brooks <mlbrooks@…>, 3 months ago
|
Add missing integration test of accordions.
Putting a CFA array inside structs was broken before the last fixes.
|
-
Property mode set to
100644
|
File size:
959 bytes
|
Line | |
---|
1 | // |
---|
2 | // Cforall Version 1.0.0 Copyright (C) 2023 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 | // accordion.cfa -- declaring a struct with more content after an array member |
---|
8 | // |
---|
9 | // Author : Mike Brooks |
---|
10 | // Created On : Mon Aug 12 12:00:00 2024 |
---|
11 | // Last Modified By : |
---|
12 | // Last Modified On : |
---|
13 | // Update Count : |
---|
14 | // |
---|
15 | |
---|
16 | |
---|
17 | #include <fstream.hfa> |
---|
18 | #include <array.hfa> |
---|
19 | |
---|
20 | forall( T, [N], [M] ) |
---|
21 | struct simple_t { |
---|
22 | T c[N + M]; |
---|
23 | array( T, N ) n; |
---|
24 | array( T, M ) m; |
---|
25 | }; |
---|
26 | |
---|
27 | void simple( void ) { |
---|
28 | |
---|
29 | sout | "simple"; |
---|
30 | |
---|
31 | simple_t(int, 5, 8) s; |
---|
32 | for ( i; 5 + 8 ) s.c[i] = i; |
---|
33 | for ( i; 5 ) s.n[i] = i; |
---|
34 | for ( i; 8 ) s.m[i] = i; |
---|
35 | for ( i; 5 + 8 ) sout | s.c[i] | nonl; sout | nl; |
---|
36 | for ( i; 5 ) sout | s.n[i] | nonl; sout | nl; |
---|
37 | for ( i; 8 ) sout | s.m[i] | nonl; sout | nl; |
---|
38 | } |
---|
39 | |
---|
40 | int main() { |
---|
41 | simple(); |
---|
42 | return 0; |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.