mirror of
https://github.com/nArnoSNES/tcc-65816.git
synced 2024-06-11 22:29:28 +00:00
22 lines
433 B
C
22 lines
433 B
C
/* PR 17252. When a char * pointer P takes its own address, storing
|
|
into *P changes P itself. */
|
|
|
|
char *a;
|
|
|
|
main ()
|
|
{
|
|
/* Make 'a' point to itself. */
|
|
a = (char *)&a;
|
|
|
|
/* Change what 'a' is pointing to. */
|
|
a[0]++;
|
|
|
|
/* If a's memory tag does not contain 'a' in its alias set, we will
|
|
think that this predicate is superfluous and change it to
|
|
'if (1)'. */
|
|
if (a == (char *)&a)
|
|
abort ();
|
|
|
|
return 0;
|
|
}
|