diff options
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/20030626-2.c')
-rw-r--r-- | SingleSource/Regression/C/gcc-c-torture/execute/20030626-2.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/20030626-2.c b/SingleSource/Regression/C/gcc-c-torture/execute/20030626-2.c new file mode 100644 index 00000000..6187acd8 --- /dev/null +++ b/SingleSource/Regression/C/gcc-c-torture/execute/20030626-2.c @@ -0,0 +1,13 @@ +char buf[40]; + +extern int sprintf (char*, const char*, ...); +extern void abort (void); + +int main() +{ + int i = 0; + int l = sprintf (buf, "%s", i++ ? "string" : "other string"); + if (l != sizeof ("other string") - 1 || i != 1) + abort (); + return 0; +} |