| 1 |
/* PR target/27531 */ |
| 2 |
/* This test case stressed the register allocator into reloading a LABEL_REF |
| 3 |
on sparc, but didn't add a REG_LABEL note, ultimately causing the assembly |
| 4 |
output to reference a label that had been eliminated. */ |
| 5 |
/* { dg-do link } */ |
| 6 |
/* { dg-options "-O2" } */ |
| 7 |
/* { dg-skip-if "requires io" { freestanding } } */ |
| 8 |
|
| 9 |
typedef struct _IO_FILE FILE; |
| 10 |
char const *RCSname; |
| 11 |
void *Locks; |
| 12 |
void * Head; |
| 13 |
struct Revpairs{ |
| 14 |
struct Revpairs * rnext; |
| 15 |
}; |
| 16 |
extern char *strchr(const char *s, int c); |
| 17 |
extern int fprintf(FILE *, const char *format, ...); |
| 18 |
static void getrevpairs (char*); |
| 19 |
static int branchflag; |
| 20 |
static struct Revpairs *revlist, *Revlst; |
| 21 |
|
| 22 |
extern int warn(const char *msg, char *argv); |
| 23 |
extern int error(const char *msg, int c, char *argv); |
| 24 |
extern int recentdate(void *foo, void *bar); |
| 25 |
|
| 26 |
char *t; |
| 27 |
int main (int argc, char **argv) |
| 28 |
{ |
| 29 |
FILE *out; |
| 30 |
char *a, **newargv; |
| 31 |
void *currdate; |
| 32 |
int descflag, selectflag; |
| 33 |
int onlylockflag; |
| 34 |
int onlyRCSflag; |
| 35 |
int shownames; |
| 36 |
descflag = selectflag = shownames = 1; |
| 37 |
onlylockflag = onlyRCSflag = 0; |
| 38 |
while (a = *++argv, 0<--argc) |
| 39 |
{ |
| 40 |
switch (*a++) |
| 41 |
{ |
| 42 |
case 'L': |
| 43 |
onlylockflag = 1; |
| 44 |
case 'N': |
| 45 |
shownames = 0; |
| 46 |
case 'R': |
| 47 |
t = a; |
| 48 |
case 'b': |
| 49 |
branchflag = 1; |
| 50 |
case 'r': |
| 51 |
getrevpairs(a); |
| 52 |
} |
| 53 |
if (onlylockflag && !Locks) |
| 54 |
fprintf(out, "%s\n", RCSname); |
| 55 |
if (shownames) |
| 56 |
while( currdate) |
| 57 |
recentdate(Head, currdate); |
| 58 |
} |
| 59 |
} |
| 60 |
void getrevpairs(char *argv) |
| 61 |
{ |
| 62 |
char c; |
| 63 |
struct Revpairs * nextrevpair; |
| 64 |
int separator; |
| 65 |
if (strchr(argv,':')) |
| 66 |
separator = ':'; |
| 67 |
else |
| 68 |
{ |
| 69 |
if (strchr(argv,'-') ) |
| 70 |
warn("`-' is obsolete in `-r%s'; use `:' instead", argv); |
| 71 |
separator = '-'; |
| 72 |
} |
| 73 |
for (;;) |
| 74 |
{ |
| 75 |
nextrevpair->rnext = revlist; |
| 76 |
for (;; c = *++argv) |
| 77 |
{ |
| 78 |
switch (c) |
| 79 |
{ |
| 80 |
default: |
| 81 |
continue; |
| 82 |
case ' ': |
| 83 |
case '\t': |
| 84 |
case '\n': |
| 85 |
break; |
| 86 |
case ':': |
| 87 |
case '-': |
| 88 |
if (c == separator) |
| 89 |
continue; |
| 90 |
} |
| 91 |
break; |
| 92 |
} |
| 93 |
if (!c) |
| 94 |
break; |
| 95 |
error("missing `,' near `%c%s'", c, argv+1); |
| 96 |
} |
| 97 |
} |
| 98 |
|
| 99 |
int warn(const char *msg, char *argv) |
| 100 |
{ |
| 101 |
t = 0; /* this function needs side-effects. */ |
| 102 |
return 0; |
| 103 |
} |
| 104 |
|
| 105 |
int error(const char *msg, int c, char *argv) |
| 106 |
{ |
| 107 |
t = 0; /* this function needs side-effects. */ |
| 108 |
return 0; |
| 109 |
} |
| 110 |
|
| 111 |
int recentdate(void *foo, void *bar) |
| 112 |
{ |
| 113 |
t = 0; /* this function needs side-effects. */ |
| 114 |
return 0; |
| 115 |
} |
| 116 |
|