2018-04-09 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / strlenopt-42.c
blob019b89e7568a5d6d3e6b51bd09aa9580686a4f84
1 /* PR tree-optimization/83781 - Bootstrap failed on x86 with --with-arch=corei7
2 --with-cpu=corei7
3 Verify that the upper bound of the size of an array of pointers
4 to strings isn't considered to be the upper bound of the lengths
5 of the pointed-to strings.
6 { dg-do compile }
7 { dg-options "-O2 -Wall" } */
9 const char* const ap[32] = { "1", "12", "123" };
11 char d4[4];
12 char d7[7];
14 void nowarn_range_ptr_var_1 (int i)
16 __builtin_sprintf (d4, "%s", ap[i]);
19 void nowarn_range_ptr_var_2 (int i, int j)
21 __builtin_sprintf (d7, "%s%s", ap[i], ap[j]);