summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/20000910-2.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-11 21:00:19 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-11 21:00:19 +0000
commit13100710a1bb77aa9ca2c761e7bd28166a96cf48 (patch)
treed53570dbea388988701a8badd790d7f31b962ce2 /gcc/testsuite/gcc.c-torture/execute/20000910-2.c
parentb65ada3a750307c93c634d6d95a03b5076abd297 (diff)
downloadgcc-13100710a1bb77aa9ca2c761e7bd28166a96cf48.tar.gz
* gcc.c-torture/execute/20000910-1.c: New test.
* gcc.c-torture/execute/20000910-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36328 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/20000910-2.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20000910-2.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20000910-2.c b/gcc/testsuite/gcc.c-torture/execute/20000910-2.c
new file mode 100644
index 00000000000..0023d2451e0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20000910-2.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2000 Free Software Foundation */
+/* by Alexandre Oliva <aoliva@redhat.com> */
+
+#include <stdlib.h>
+#include <string.h>
+
+char *list[] = { "*", "e" };
+
+static int bar (const char *fmt) {
+ return (strchr (fmt, '*') != 0);
+}
+
+static void foo () {
+ int i;
+ for (i = 0; i < sizeof (list) / sizeof (*list); i++) {
+ const char *fmt = list[i];
+ if (bar (fmt))
+ continue;
+ if (i == 0)
+ abort ();
+ else
+ exit (0);
+ }
+}
+
+int main () {
+ foo ();
+}