blob: 96cb9d61bfd68b1a6ecc3a58f3f513046381bf7a [file] [log] [blame]
Stephen Hinesc202d2d2011-01-26 11:57:57 -08001#pragma version(1)
2#pragma rs java_package_name(foo)
3
Stephen Hines55c081c2014-08-14 16:32:50 -07004rs_allocation globalAlloc;
5rs_allocation globalAlloc2;
Stephen Hinesc202d2d2011-01-26 11:57:57 -08006
Stephen Hinesb0fabe52013-01-07 19:06:09 -08007struct hasMatrix {
8 rs_matrix3x3 m;
9} ghm;
10
Stephen Hinesc202d2d2011-01-26 11:57:57 -080011static void foo() {
12
Stephen Hines55c081c2014-08-14 16:32:50 -070013 rs_allocation allocUninit;
14 rs_allocation allocArr[10];
15 allocUninit = globalAlloc;
Stephen Hinesc202d2d2011-01-26 11:57:57 -080016 for (int i = 0; i < 10; i++) {
Stephen Hines55c081c2014-08-14 16:32:50 -070017 allocArr[i] = globalAlloc;
Stephen Hinesc202d2d2011-01-26 11:57:57 -080018 }
19
20 return;
21}
22
23void singleStmt() {
Stephen Hinesb0fabe52013-01-07 19:06:09 -080024 struct hasMatrix h = ghm;
25 ghm = h;
Stephen Hinesc202d2d2011-01-26 11:57:57 -080026 globalAlloc = globalAlloc2;
27}
28
Stephen Hines5baf6322011-04-25 17:21:15 -070029int root(void) {
Stephen Hinesc202d2d2011-01-26 11:57:57 -080030 foo();
31 return 10;
32}
33