mirror of
https://github.com/nArnoSNES/tcc-65816.git
synced 2024-06-12 13:29:29 +00:00
51 lines
741 B
C
51 lines
741 B
C
/* 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 int i = 1;
|
|
|
|
static __inline__ void doit(void **pptr, int cond)
|
|
{
|
|
if (cond) {
|
|
here:
|
|
*pptr = &&here;
|
|
}
|
|
}
|
|
|
|
__attribute__ ((noinline))
|
|
static void f(int cond)
|
|
{
|
|
doit (&ptr1, cond);
|
|
}
|
|
|
|
__attribute__ ((noinline))
|
|
static void g(int cond)
|
|
{
|
|
doit (&ptr2, cond);
|
|
}
|
|
|
|
__attribute__ ((noinline))
|
|
void bar(void);
|
|
|
|
int main()
|
|
{
|
|
f (i);
|
|
bar();
|
|
g (i);
|
|
|
|
#ifdef __OPTIMIZE__
|
|
if (ptr1 == ptr2)
|
|
abort ();
|
|
#endif
|
|
|
|
exit (0);
|
|
}
|
|
|
|
void bar(void) { }
|
|
|
|
#else /* NO_LABEL_VALUES */
|
|
int main() { exit(0); }
|
|
#endif
|