Stephen Hines | c202d2d | 2011-01-26 11:57:57 -0800 | [diff] [blame] | 1 | #pragma version(1) |
2 | #pragma rs java_package_name(foo) | ||||
3 | |||||
Stephen Hines | 55c081c | 2014-08-14 16:32:50 -0700 | [diff] [blame] | 4 | rs_allocation globalAlloc; |
5 | rs_allocation globalAlloc2; | ||||
Stephen Hines | c202d2d | 2011-01-26 11:57:57 -0800 | [diff] [blame] | 6 | |
Stephen Hines | b0fabe5 | 2013-01-07 19:06:09 -0800 | [diff] [blame] | 7 | struct hasMatrix { |
8 | rs_matrix3x3 m; | ||||
9 | } ghm; | ||||
10 | |||||
Stephen Hines | c202d2d | 2011-01-26 11:57:57 -0800 | [diff] [blame] | 11 | static void foo() { |
12 | |||||
Stephen Hines | 55c081c | 2014-08-14 16:32:50 -0700 | [diff] [blame] | 13 | rs_allocation allocUninit; |
14 | rs_allocation allocArr[10]; | ||||
15 | allocUninit = globalAlloc; | ||||
Stephen Hines | c202d2d | 2011-01-26 11:57:57 -0800 | [diff] [blame] | 16 | for (int i = 0; i < 10; i++) { |
Stephen Hines | 55c081c | 2014-08-14 16:32:50 -0700 | [diff] [blame] | 17 | allocArr[i] = globalAlloc; |
Stephen Hines | c202d2d | 2011-01-26 11:57:57 -0800 | [diff] [blame] | 18 | } |
19 | |||||
20 | return; | ||||
21 | } | ||||
22 | |||||
23 | void singleStmt() { | ||||
Stephen Hines | b0fabe5 | 2013-01-07 19:06:09 -0800 | [diff] [blame] | 24 | struct hasMatrix h = ghm; |
25 | ghm = h; | ||||
Stephen Hines | c202d2d | 2011-01-26 11:57:57 -0800 | [diff] [blame] | 26 | globalAlloc = globalAlloc2; |
27 | } | ||||
28 | |||||
Stephen Hines | 5baf632 | 2011-04-25 17:21:15 -0700 | [diff] [blame] | 29 | int root(void) { |
Stephen Hines | c202d2d | 2011-01-26 11:57:57 -0800 | [diff] [blame] | 30 | foo(); |
31 | return 10; | ||||
32 | } | ||||
33 |