comparison gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-9.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
36 36
37 /* Identity function to verify that the checker figures out the value 37 /* Identity function to verify that the checker figures out the value
38 of the operand even when it's not constant (i.e., makes use of 38 of the operand even when it's not constant (i.e., makes use of
39 inlining and constant propagation information). */ 39 inlining and constant propagation information). */
40 40
41 int i (int x) { return x; } 41 static int i (int x) { return x; }
42 const char* s (const char *str) { return str; } 42 static const char* s (const char *str) { return str; }
43 43
44 /* Function to "generate" a unique unknown number (as far as GCC can 44 /* Function to "generate" a unique unknown number (as far as GCC can
45 tell) each time it's called. It prevents the optimizer from being 45 tell) each time it's called. It prevents the optimizer from being
46 able to narrow down the ranges of possible values in test functions 46 able to narrow down the ranges of possible values in test functions
47 with repeated references to the same variable. */ 47 with repeated references to the same variable. */
48 extern int value (void); 48 extern int value (void);
49 49
50 /* Return a value in the range [MIN, MAX]. */ 50 /* Return a value in the range [MIN, MAX]. */
51 int range (int min, int max) 51 static int range (int min, int max)
52 { 52 {
53 int val = value (); 53 int val = value ();
54 return val < min || max < val ? min : val; 54 return val < min || max < val ? min : val;
55 } 55 }
56 56