PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20030626-2.c
blob5483d0cba5471aae7dffd8528bdd26b493b270cc
1 char buf[40];
3 extern int sprintf (char*, const char*, ...);
4 extern void abort (void);
6 int main()
8 int i = 0;
9 int l = sprintf (buf, "%s", i++ ? "string" : "other string");
10 if (l != sizeof ("other string") - 1 || i != 1)
11 abort ();
12 return 0;