20000910-1.c: New test.
* gcc.c-torture/execute/20000910-1.c: New test. * gcc.c-torture/execute/20000910-2.c: Likewise. From-SVN: r36328
This commit is contained in:
parent
2a1da89b74
commit
da88b35278
@ -1,3 +1,8 @@
|
||||
2000-09-11 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* gcc.c-torture/execute/20000910-1.c: New test.
|
||||
* gcc.c-torture/execute/20000910-2.c: Likewise.
|
||||
|
||||
2000-09-11 Robert Lipe <robertl@sco.com>
|
||||
|
||||
* gcc.dg/pragma-align.c: New test.
|
||||
|
27
gcc/testsuite/gcc.c-torture/execute/20000910-1.c
Normal file
27
gcc/testsuite/gcc.c-torture/execute/20000910-1.c
Normal file
@ -0,0 +1,27 @@
|
||||
/* Copyright (C) 2000 Free Software Foundation */
|
||||
/* by Alexandre Oliva <aoliva@redhat.com> */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
void bar (int);
|
||||
void foo (int *);
|
||||
|
||||
int main () {
|
||||
static int a[] = { 0, 1, 2 };
|
||||
int *i = &a[sizeof(a)/sizeof(*a)];
|
||||
|
||||
while (i-- > a)
|
||||
foo (i);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
void baz (int, int);
|
||||
|
||||
void bar (int i) { baz (i, i); }
|
||||
void foo (int *i) { bar (*i); }
|
||||
|
||||
void baz (int i, int j) {
|
||||
if (i != j)
|
||||
abort ();
|
||||
}
|
28
gcc/testsuite/gcc.c-torture/execute/20000910-2.c
Normal file
28
gcc/testsuite/gcc.c-torture/execute/20000910-2.c
Normal file
@ -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 ();
|
||||
}
|
Loading…
Reference in New Issue
Block a user