comparison gcc/testsuite/gcc.dg/tree-ssa/pr83198.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* PR tree-optimization/83198 */
2 /* { dg-do compile { target __float128 } } */
3 /* { dg-options "-O2 -fprintf-return-value -Wno-format -fdump-tree-optimized" } */
4 /* { dg-add-options __float128 } */
5
6 void bar (void);
7 void link_error (void);
8
9 void
10 foo (char *x, double y)
11 {
12 /* The expected result should not be constant but rather that
13 of the %f directive with an unknown argument, i.e., at least
14 [3, 317] (but in reality [3, 322] when taking into account
15 that the decimal point can be up to MB_LEN_MAX bytes long). */
16 int a = __builtin_sprintf (x, "%f", 1.0Q);
17 if (a < 3)
18 link_error ();
19 if (a > 13)
20 bar ();
21 if (a > 322)
22 link_error ();
23 }
24
25 /* Verify we don't optimize return value to [3, 13]. */
26 /* { dg-final { scan-tree-dump-not "link_error \\(\\);" "optimized" } } */
27 /* { dg-final { scan-tree-dump "bar \\(\\);" "optimized" } } */