From 20d83a046afd6ae7fdb091cd5ee2e0c27e058b32 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 8 Feb 1999 13:43:39 -0800 Subject: [PATCH] * gcc.c-torture/execute/990208-1.c: New test. From-SVN: r25101 --- gcc/testsuite/ChangeLog | 4 ++ .../gcc.c-torture/execute/990208-1.c | 46 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/990208-1.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d51803cadb6..74e96b08d51 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +Mon Feb 8 21:42:57 1999 Richard Henderson + + * gcc.c-torture/execute/990208-1.c: New test. + 1999-02-07 Jonathan Larmour * g++.dg/special/ecos.exp: New driver for new tests with special diff --git a/gcc/testsuite/gcc.c-torture/execute/990208-1.c b/gcc/testsuite/gcc.c-torture/execute/990208-1.c new file mode 100644 index 00000000000..37a11472962 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/990208-1.c @@ -0,0 +1,46 @@ +/* As a quality of implementation issue, we should not prevent inlining + of function explicitly marked inline just because a label therein had + its address taken. */ + +#ifndef NO_LABEL_VALUES +static void *ptr1, *ptr2; + +static __inline__ void doit(void **pptr, int cond) +{ + if (cond) { + here: + *pptr = &&here; + } +} + +static void f(int cond) +{ + doit (&ptr1, cond); +} + +static void g(int cond) +{ + doit (&ptr2, cond); +} + +static void bar(void); + +int main() +{ + f (1); + bar(); + g (1); + +#ifdef __OPTIMIZE__ + if (ptr1 == ptr2) + abort (); +#endif + + exit (0); +} + +void bar(void) { } + +#else /* NO_LABEL_VALUES */ +int main() { exit(0); } +#endif