mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-18 12:24:38 +08:00
c2aad00a74
Extend the common test framework to support $pwd replacements in settings. This allows replacing the custom cris @exedir@ with it.
29 lines
493 B
C
29 lines
493 B
C
/* Simulator options:
|
|
#notarget: cris*-*-elf
|
|
#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, argv[0]);
|
|
if (lstat (".", &buf) != 0
|
|
|| !S_ISDIR (buf.st_mode))
|
|
abort ();
|
|
if (lstat (path, &buf) != 0
|
|
|| !S_ISREG (buf.st_mode))
|
|
abort ();
|
|
printf ("pass\n");
|
|
exit (0);
|
|
}
|
|
|