mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-24 12:35:55 +08:00
e1e1ae6e9b
The tests assume that the cwd is the objdir directory and write its intermediates to there all the time. When using runtest's --objdir setting though, this puts the files in the wrong place. This isn't a big problem currently as we never change --objdir, but in order to support parallel test execution, we're going to start setting that option, so clean up the code ahead of time. We also have to tweak some of the cris tests which were making assumptions about the argv[0] value.
27 lines
476 B
C
27 lines
476 B
C
/* Simulator options:
|
|
#sim: --sysroot=$pwd
|
|
*/
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
int main (int argc, char *argv[])
|
|
{
|
|
char path[1024] = "/";
|
|
struct stat buf;
|
|
|
|
strcat (path, basename (argv[0]));
|
|
if (stat (".", &buf) != 0
|
|
|| !S_ISDIR (buf.st_mode))
|
|
abort ();
|
|
if (stat (path, &buf) != 0
|
|
|| !S_ISREG (buf.st_mode))
|
|
abort ();
|
|
printf ("pass\n");
|
|
exit (0);
|
|
}
|
|
|