@@ -60,10 +60,10 @@ pub fn test1(a: *const u8) {
6060 // missing-NOT: __stack_chk_fail
6161}
6262
63- // test3 : array [4 x i8]
64- // CHECK-LABEL: test3 {{:|\[}}
63+ // test2 : array [4 x i8]
64+ // CHECK-LABEL: test2 {{:|\[}}
6565#[ no_mangle]
66- pub fn test3 ( a : * const u8 ) {
66+ pub fn test2 ( a : * const u8 ) {
6767 let mut buf: [ u8 ; 4 ] = [ 0 ; 4 ] ;
6868
6969 unsafe {
@@ -77,10 +77,10 @@ pub fn test3(a: *const u8) {
7777 // missing-NOT: __stack_chk_fail
7878}
7979
80- // test5 : no arrays / no nested arrays
81- // CHECK-LABEL: test5 {{:|\[}}
80+ // test3 : no arrays / no nested arrays
81+ // CHECK-LABEL: test3 {{:|\[}}
8282#[ no_mangle]
83- pub fn test5 ( a : * const u8 ) {
83+ pub fn test3 ( a : * const u8 ) {
8484 unsafe {
8585 printf ( STR . as_ptr ( ) , a) ;
8686 }
@@ -91,10 +91,10 @@ pub fn test5(a: *const u8) {
9191 // missing-NOT: __stack_chk_fail
9292}
9393
94- // test6 : Address-of local taken (j = &a)
95- // CHECK-LABEL: test6 {{:|\[}}
94+ // test4 : Address-of local taken (j = &a)
95+ // CHECK-LABEL: test4 {{:|\[}}
9696#[ no_mangle]
97- pub unsafe extern "C" fn test6 ( ) {
97+ pub unsafe extern "C" fn test4 ( ) {
9898 let mut a: i32 = 0 ;
9999
100100 let mut j: * mut i32 = std:: ptr:: null_mut ( ) ;
@@ -111,10 +111,10 @@ pub unsafe extern "C" fn test6() {
111111 // missing-NOT: __stack_chk_fail
112112}
113113
114- // test7 : PtrToInt Cast
115- // CHECK-LABEL: test7 {{:|\[}}
114+ // test5 : PtrToInt Cast
115+ // CHECK-LABEL: test5 {{:|\[}}
116116#[ no_mangle]
117- pub fn test7 ( a : i32 ) {
117+ pub fn test5 ( a : i32 ) {
118118 let ptr_val: usize = & a as * const i32 as usize ;
119119
120120 unsafe {
@@ -127,10 +127,10 @@ pub fn test7(a: i32) {
127127 // missing-NOT: __stack_chk_fail
128128}
129129
130- // test8 : Passing addr-of to function call
131- // CHECK-LABEL: test8 {{:|\[}}
130+ // test6 : Passing addr-of to function call
131+ // CHECK-LABEL: test6 {{:|\[}}
132132#[ no_mangle]
133- pub fn test8 ( mut b : i32 ) {
133+ pub fn test6 ( mut b : i32 ) {
134134 unsafe {
135135 funcall ( & mut b as * mut i32 ) ;
136136 }
@@ -141,10 +141,10 @@ pub fn test8(mut b: i32) {
141141 // missing-NOT: __stack_chk_fail
142142}
143143
144- // test9 : Addr-of in select instruction
145- // CHECK-LABEL: test9 {{:|\[}}
144+ // test7 : Addr-of in select instruction
145+ // CHECK-LABEL: test7 {{:|\[}}
146146#[ no_mangle]
147- pub fn test9 ( ) {
147+ pub fn test7 ( ) {
148148 let x: f64 ;
149149
150150 unsafe {
@@ -162,10 +162,10 @@ pub fn test9() {
162162 // missing-NOT: __stack_chk_fail
163163}
164164
165- // test10 : Addr-of in phi instruction
166- // CHECK-LABEL: test10 {{:|\[}}
165+ // test8 : Addr-of in phi instruction
166+ // CHECK-LABEL: test8 {{:|\[}}
167167#[ no_mangle]
168- pub fn test10 ( ) {
168+ pub fn test8 ( ) {
169169 let mut _x: f64 ;
170170
171171 unsafe {
@@ -195,10 +195,10 @@ pub fn test10() {
195195 // missing-NOT: __stack_chk_fail
196196}
197197
198- // test11 : Addr-of struct element(GEP followed by store)
199- // CHECK-LABEL: test11 {{:|\[}}
198+ // test9 : Addr-of struct element(GEP followed by store)
199+ // CHECK-LABEL: test9 {{:|\[}}
200200#[ no_mangle]
201- pub fn test11 ( ) {
201+ pub fn test9 ( ) {
202202 let mut c = Pair { a : 0 , b : 0 } ;
203203 let b: * mut i32 ;
204204
@@ -216,10 +216,10 @@ pub fn test11() {
216216 // missing-NOT: __stack_chk_fail
217217}
218218
219- // test12 : Addr-of struct element, GEP followed by ptrtoint
220- // CHECK-LABEL: test12 {{:|\[}}
219+ // test10 : Addr-of struct element, GEP followed by ptrtoint
220+ // CHECK-LABEL: test10 {{:|\[}}
221221#[ no_mangle]
222- pub fn test12 ( ) {
222+ pub fn test10 ( ) {
223223 let mut c = Pair { a : 0 , b : 0 } ;
224224
225225 unsafe {
@@ -236,10 +236,10 @@ pub fn test12() {
236236 // missing-NOT: __stack_chk_fail
237237}
238238
239- // test13 : Addr-of struct element, GEP followed by callinst
240- // CHECK-LABEL: test13 {{:|\[}}
239+ // test11 : Addr-of struct element, GEP followed by callinst
240+ // CHECK-LABEL: test11 {{:|\[}}
241241#[ no_mangle]
242- pub fn test13 ( ) {
242+ pub fn test11 ( ) {
243243 let mut c = Pair { a : 0 , b : 0 } ;
244244
245245 unsafe {
@@ -254,10 +254,10 @@ pub fn test13() {
254254 // missing-NOT: __stack_chk_fail
255255}
256256
257- // test14 : Addr-of a local, optimized into a GEP (e.g., &a - 12)
258- // CHECK-LABEL: test14 {{:|\[}}
257+ // test12 : Addr-of a local, optimized into a GEP (e.g., &a - 12)
258+ // CHECK-LABEL: test12 {{:|\[}}
259259#[ no_mangle]
260- pub fn test14 ( ) {
260+ pub fn test12 ( ) {
261261 let mut a: i32 = 0 ;
262262
263263 unsafe {
@@ -272,11 +272,11 @@ pub fn test14() {
272272 // missing-NOT: __stack_chk_fail
273273}
274274
275- // test15 : Addr-of a local cast to a ptr of a different type
275+ // test13 : Addr-of a local cast to a ptr of a different type
276276// (e.g., int a; ... ; ptr b = &a;)
277- // CHECK-LABEL: test15 {{:|\[}}
277+ // CHECK-LABEL: test13 {{:|\[}}
278278#[ no_mangle]
279- pub fn test15 ( ) {
279+ pub fn test13 ( ) {
280280 let mut a: i32 = 0 ;
281281
282282 unsafe {
@@ -294,11 +294,11 @@ pub fn test15() {
294294 // missing-NOT: __stack_chk_fail
295295}
296296
297- // test16 : Addr-of a local cast to a ptr of a different type (optimized)
297+ // test14 : Addr-of a local cast to a ptr of a different type (optimized)
298298// (e.g., int a; ... ; ptr b = &a;)
299- // CHECK-LABEL: test16 {{:|\[}}
299+ // CHECK-LABEL: test14 {{:|\[}}
300300#[ no_mangle]
301- pub fn test16 ( ) {
301+ pub fn test14 ( ) {
302302 let a: i32 = 0 ;
303303 unsafe {
304304 funfloat ( ( & a as * const i32 ) . cast :: < f64 > ( ) as * mut f64 ) ;
@@ -310,10 +310,10 @@ pub fn test16() {
310310 // missing-NOT: __stack_chk_fail
311311}
312312
313- // test18 : Addr-of a variable passed into an invoke instruction
314- // CHECK-LABEL: test18 {{:|\[}}
313+ // test15 : Addr-of a variable passed into an invoke instruction
314+ // CHECK-LABEL: test15 {{:|\[}}
315315#[ no_mangle]
316- pub unsafe extern "C" fn test18 ( ) -> i32 {
316+ pub unsafe extern "C" fn test15 ( ) -> i32 {
317317 let mut a: i32 = 0 ;
318318
319319 except ( & mut a as * mut i32 ) ;
@@ -326,11 +326,11 @@ pub unsafe extern "C" fn test18() -> i32 {
326326 // missing-NOT: __stack_chk_fail
327327}
328328
329- // test19 : Addr-of a struct element passed into an invoke instruction
329+ // test16 : Addr-of a struct element passed into an invoke instruction
330330// (GEP followed by an invoke)
331- // CHECK-LABEL: test19 {{:|\[}}
331+ // CHECK-LABEL: test16 {{:|\[}}
332332#[ no_mangle]
333- pub unsafe extern "C" fn test19 ( ) -> i32 {
333+ pub unsafe extern "C" fn test16 ( ) -> i32 {
334334 let mut c = Pair { a : 0 , b : 0 } ;
335335
336336 except ( & mut c. a as * mut i32 ) ;
@@ -343,10 +343,10 @@ pub unsafe extern "C" fn test19() -> i32 {
343343 // missing-NOT: __stack_chk_fail
344344}
345345
346- // test20 : Addr-of a pointer
347- // CHECK-LABEL: test20 {{:|\[}}
346+ // test17 : Addr-of a pointer
347+ // CHECK-LABEL: test17 {{:|\[}}
348348#[ no_mangle]
349- pub unsafe extern "C" fn test20 ( ) {
349+ pub unsafe extern "C" fn test17 ( ) {
350350 let mut a: * mut i32 = getp ( ) ;
351351
352352 let mut _b: * mut * mut i32 = std:: ptr:: null_mut ( ) ;
@@ -363,10 +363,10 @@ pub unsafe extern "C" fn test20() {
363363 // missing-NOT: __stack_chk_fail
364364}
365365
366- // test21 : Addr-of a casted pointer
367- // CHECK-LABEL: test21 {{:|\[}}
366+ // test18 : Addr-of a casted pointer
367+ // CHECK-LABEL: test18 {{:|\[}}
368368#[ no_mangle]
369- pub unsafe extern "C" fn test21 ( ) {
369+ pub unsafe extern "C" fn test18 ( ) {
370370 let mut a: * mut i32 = getp ( ) ;
371371
372372 let mut _b: * mut * mut i32 = std:: ptr:: null_mut ( ) ;
@@ -383,10 +383,10 @@ pub unsafe extern "C" fn test21() {
383383 // missing-NOT: __stack_chk_fail
384384}
385385
386- // test25 : array of [4 x i32]
387- // CHECK-LABEL: test25 {{:|\[}}
386+ // test19 : array of [4 x i32]
387+ // CHECK-LABEL: test19 {{:|\[}}
388388#[ no_mangle]
389- pub unsafe extern "C" fn test25 ( ) -> i32 {
389+ pub unsafe extern "C" fn test19 ( ) -> i32 {
390390 let a: [ i32 ; 4 ] = [ 0 ; 4 ] ;
391391
392392 let _whole = std:: ptr:: read_volatile ( & a as * const _ ) ; // avoid array a from optimization
@@ -399,12 +399,12 @@ pub unsafe extern "C" fn test25() -> i32 {
399399 // missing-NOT: __stack_chk_fail
400400}
401401
402- // test26 : Nested structure, no arrays, no address-of expressions
402+ // test20 : Nested structure, no arrays, no address-of expressions
403403// Verify that the resulting gep-of-gep does not incorrectly trigger
404404// a stack protector
405- // CHECK-LABEL: test26 {{:|\[}}
405+ // CHECK-LABEL: test20 {{:|\[}}
406406#[ no_mangle]
407- pub unsafe extern "C" fn test26 ( ) {
407+ pub unsafe extern "C" fn test20 ( ) {
408408 let c = Nest { first : Pair { a : 10 , b : 11 } , second : Pair { a : 20 , b : 21 } } ;
409409
410410 let whole: Nest = std:: ptr:: read_volatile ( & c) ;
@@ -416,14 +416,14 @@ pub unsafe extern "C" fn test26() {
416416 // strong-NOT: __stack_chk_fail
417417}
418418
419- // test27 : Address-of a structure taken in a function with a loop where
419+ // test21 : Address-of a structure taken in a function with a loop where
420420// the alloca is an incoming value to a PHI node and a use of that PHI
421421// node is also an incoming value
422422// Verify that the address-of analysis does not get stuck in infinite
423423// recursion when chasing the alloca through the PHI nodes
424- // CHECK-LABEL: test27 {{:|\[}}
424+ // CHECK-LABEL: test21 {{:|\[}}
425425#[ no_mangle]
426- pub unsafe extern "C" fn test27 ( ) -> i32 {
426+ pub unsafe extern "C" fn test21 ( ) -> i32 {
427427 let mut tmp: * mut u8 = std:: ptr:: null_mut ( ) ;
428428 let tmp_ptr: * mut * mut u8 = & mut tmp;
429429
0 commit comments