Lines Matching defs:TenElements

4 int TenElements[10];
7 int a = TenElements[arg];
10 int b = TenElements[13];
11 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
12 // expected-note@-2 {{Access of 'TenElements' at index 13, while it holds only 10 'int' elements}}
18 int a = TenElements[arg];
19 // expected-note@-1 {{Assuming index is non-negative and less than 10, the number of 'int' elements in 'TenElements'}}
20 int b = TenElements[arg]; // no additional note, we already assumed that 'arg' is in bounds
21 int c = TenElements[arg + 10];
22 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
23 // expected-note@-2 {{Access of 'TenElements' at an overflowing index, while it holds only 10 'int' elements}}
28 // If we're accessing an TenElements through a pointer pointing to its middle, the checker
29 // will speak about the "byte offset" measured from the beginning of the TenElements.
30 int *p = TenElements + 2;
33 // {{Assuming byte offset is non-negative and less than 40, the extent of 'TenElements'}}
36 // it's equivalent to `TenElements[2+arg]`).
38 int b = TenElements[arg]; // This is normal access, and only the lower bound is new.
40 int c = TenElements[arg + 10];
41 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
42 // expected-note@-2 {{Access of 'TenElements' at an overflowing index, while it holds only 10 'int' elements}}
51 int a = TenElements[arg];
53 int b = TenElements[arg + 10];
54 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
55 // expected-note@-2 {{Access of 'TenElements' at an overflowing index, while it holds only 10 'int' elements}}
64 int a = TenElements[arg];
65 // expected-note@-1 {{Assuming index is less than 10, the number of 'int' elements in 'TenElements'}}
66 int b = TenElements[arg - 10];
67 // expected-warning@-1 {{Out of bound access to memory preceding 'TenElements'}}
68 // expected-note@-2 {{Access of 'TenElements' at negative byte offset}}
84 int a = TenElements[arg];
85 // expected-note@-1 {{Assuming index is less than 10, the number of 'int' elements in 'TenElements'}}
86 int b = TenElements[arg + 10];
87 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
88 // expected-note@-2 {{Access of 'TenElements' at an overflowing index, while it holds only 10 'int' elements}}
93 int a = TenElements[arg];
94 // expected-note@-1 {{Assuming index is less than 10, the number of 'int' elements in 'TenElements'}}
95 int b = TenElements[(int)arg - 10];
96 // expected-warning@-1 {{Out of bound access to memory preceding 'TenElements'}}
97 // expected-note@-2 {{Access of 'TenElements' at negative byte offset}}
106 int a = TenElements[arg]; // no note here, we already know that 'arg' is in bounds
107 int b = TenElements[(int)arg - 10];
108 // expected-warning@-1 {{Out of bound access to memory preceding 'TenElements'}}
109 // expected-note@-2 {{Access of 'TenElements' at negative byte offset}}
116 char *cp = (char*)TenElements;
118 // expected-note@-1 {{Assuming index is non-negative and less than 40, the number of 'char' elements in 'TenElements'}}
121 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
122 // expected-note@-2 {{Access of 'TenElements' at an overflowing index, while it holds only 40 'char' elements}}
141 int c = TenElements[arg-2];
142 // expected-warning@-1 {{Out of bound access to memory preceding 'TenElements'}}
143 // expected-note@-2 {{Access of 'TenElements' at negative byte offset}}
163 int c = TenElements[arg+10];
164 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
165 // expected-note@-2 {{Access of 'TenElements' at an overflowing index, while it holds only 10 'int' elements}}
183 return TenElements[arg];
184 // expected-warning@-1 {{Out of bound access to memory after the end of 'TenElements'}}
185 // expected-note@-2 {{Access of 'TenElements' at an overflowing index, while it holds only 10 'int' elements}}
193 TenElements[arg] = 123;
194 // expected-note@-1 {{Assuming index is non-negative and less than 10, the number of 'int' elements in 'TenElements'}}