1 #include "../../gcc.dg/analyzer/analyzer-decls.h"
9 /* Copying from one on-stack array to another. */
13 struct coord arr_a
[16];
14 struct coord arr_b
[16];
20 __analyzer_eval (arr_b
[7].x
== 5); /* { dg-warning "TRUE" } */
21 __analyzer_eval (arr_b
[7].y
== 6); /* { dg-warning "TRUE" } */
24 /* Copying from an on-stack array to a global array. */
26 struct coord glob_arr2
[16];
34 glob_arr2
[7] = arr
[3];
36 __analyzer_eval (glob_arr2
[7].x
== 5); /* { dg-warning "TRUE" } */
37 __analyzer_eval (glob_arr2
[7].y
== 6); /* { dg-warning "TRUE" } */
40 /* Copying from a partially initialized on-stack array to a global array. */
42 struct coord glob_arr3
[16];
49 glob_arr3
[7] = arr
[3]; // or should the uninit warning be here?
51 __analyzer_eval (glob_arr3
[7].y
== 6); /* { dg-warning "TRUE" } */
52 __analyzer_eval (glob_arr3
[7].x
); /* { dg-warning "uninitialized" "uninit" } */
55 /* Symbolic bindings: copying from one array to another. */
59 struct coord arr_a
[16];
60 struct coord arr_b
[16];
63 __analyzer_eval (arr_a
[i
].x
== 5); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
64 /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
65 __analyzer_eval (arr_a
[i
].y
== 6); /* { dg-warning "TRUE" } */
69 __analyzer_eval (arr_b
[i
].x
== 5); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
70 /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
71 __analyzer_eval (arr_b
[i
].y
== 6); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
72 /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
75 /* Symbolic bindings: copying within an array: symbolic src and dest */
77 void test_5a (int i
, int j
)
85 __analyzer_eval (arr
[j
].x
== 5); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
86 /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
87 __analyzer_eval (arr
[j
].y
== 6); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
88 /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
91 /* Symbolic bindings: copying within an array: symbolic src, concrete dest. */
101 __analyzer_eval (arr
[3].x
== 5); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
102 /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
103 __analyzer_eval (arr
[3].y
== 6); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
104 /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
107 /* Symbolic bindings: copying within an array: concrete src, symbolic dest. */
111 struct coord arr
[16];
117 __analyzer_eval (arr
[i
].x
== 5); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
118 /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
119 __analyzer_eval (arr
[i
].y
== 6); /* { dg-warning "TRUE" "TRUE" { xfail *-*-* } } */
120 /* { dg-bogus "UNKNOWN" "UNKNOWN" { xfail *-*-* } .-1 } */
123 /* No info on the subregion being copied, and hence
124 binding_cluster2::maybe_get_compound_binding should return NULL. */
126 struct coord glob_arr6
[16];
130 struct coord arr
[16];
131 arr
[7] = glob_arr6
[3];
133 __analyzer_eval (arr
[7].x
== 5); /* { dg-warning "UNKNOWN" } */
134 __analyzer_eval (arr
[7].y
== 6); /* { dg-warning "UNKNOWN" } */