8 out B1 {precise T s; float x;} partial_precise_block;
9 precise out B2 {T s; float x;} all_precise_block;
11 float struct_member() {
21 S2.f1 = a + 0.2; // NoContraction
22 S2.f2 = b + 0.2; // NOT NoContraction
23 S3.f1 = a + b; // NOT NoContraction
24 S = S2; // "precise" propagated through parent object nodes
25 result = S.f1 + 0.1; // the ADD operation should be NoContraction
30 float complex_array_struct() {
41 struct T3 {float f; T2 t2; vec4 v; int p;};
43 for(int i=0; i<10; i++) {
44 t3[i].f = i / 3.0; // Not NoContraction
45 t3[i].v = vec4(i * 1.5); // NoContraction
47 for(int j=0; j<5; j++) {
48 for(int k = 0; k<3; k++) {
49 t3[i].t2.t1a[j].t1_array[k] = i * j + k; // Not NoContraction
51 t3[i].t2.t1a[j].t1_scalar = j * 2.0 / i; // Not NoContration
54 for(int j=0; j<6; j++) {
55 for(int k = 0; k<3; k++) {
56 t3[i].t2.t1b[j].t1_array[k] = i * j + k; // Not NoContraction
58 t3[i].t2.t1b[j].t1_scalar = j * 2.0 / i; // NoContraction
61 for(int j=0; j<6; j++) {
62 for(int k = 0; k<3; k++) {
63 t3[i].t2.t1c[j].t1_array[k] = i * j + k; // Not NoContraction because all operands are integers
65 t3[i].t2.t1c[j].t1_scalar = j * 2.0 / i; // Not NoContraction
69 result = t3[5].t2.t1c[6].t1_array[1]
70 + t3[2].t2.t1b[1].t1_scalar
71 + t3[i - 1].v.xy.x; // NoContraction
78 partial_precise_block.s.f1 = a + b; // NoContraction
79 partial_precise_block.s.f2 = a - b; // NoContraction
80 partial_precise_block.x = a * b; // Not NoContraction
82 all_precise_block.s.f1 = a + b + 1.0; // NoContraction
83 all_precise_block.s.f2 = a - b - 1.0; // NoContraction
84 all_precise_block.x = a * b * 2.0; // Also NoContraction
86 return a + b; // Not NoContraction