builtin-has-attribute-4.c: Skip on 32-bit hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / gcc.dg / Wstringop-truncation-6.c
blobb58f291afa804943e69f3c68f78b9f35eafc4e47
1 /* PR tree-optimization/88659 - ICE in maybe_warn_nonstring_arg
2 { dg-do compile }
3 { dg-options "-O0 -Wall" } */
5 const char a[5] = "1234";
7 int cst_idx_cst_bnd (void)
9 return __builtin_strnlen (&a[1], 0);
12 int var_idx_cst_bnd (void)
14 int i = 1;
15 return __builtin_strnlen (&a[i], 0);
18 int phi_idx_cst_bnd (int i)
20 return __builtin_strnlen (&a[i ? 1 : 2], 0);
23 int unk_idx_cst_bnd (int i)
25 return __builtin_strnlen (&a[i], 0);
28 int cst_idx_var_bnd (void)
30 int n = 0;
31 return __builtin_strnlen (&a[1], n);
34 int cst_idx_phi_bnd (int n)
36 return __builtin_strnlen (&a[1], n ? 1 : 2);
39 int cst_idx_unk_bnd (int n)
41 return __builtin_strnlen (&a[1], n);