mirror of
https://github.com/mirror/make.git
synced 2025-01-03 00:40:34 +08:00
[SV 63100] Set the floc of every created goal dep struct
* src/read.c (eval): Initialize the goaldep floc pointer. * tests/scripts/features/loadapi: Verify that the floc is set after unloading and reloading dynamic objects.
This commit is contained in:
parent
38116baee9
commit
6c87f3fb85
@ -984,6 +984,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
|||||||
/* Otherwise add it to the list to be rebuilt. */
|
/* Otherwise add it to the list to be rebuilt. */
|
||||||
deps = alloc_goaldep ();
|
deps = alloc_goaldep ();
|
||||||
deps->next = read_files;
|
deps->next = read_files;
|
||||||
|
deps->floc = ebuf->floc;
|
||||||
read_files = deps;
|
read_files = deps;
|
||||||
deps->file = f;
|
deps->file = f;
|
||||||
}
|
}
|
||||||
|
@ -71,16 +71,23 @@ func_test (const char *funcname, unsigned int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
testapi_gmk_setup ()
|
testapi_gmk_setup (const gmk_floc *floc)
|
||||||
{
|
{
|
||||||
|
const char *verbose = getenv ("TESTAPI_VERBOSE");
|
||||||
|
|
||||||
gmk_add_function ("test-expand", func_test, 1, 1, GMK_FUNC_DEFAULT);
|
gmk_add_function ("test-expand", func_test, 1, 1, GMK_FUNC_DEFAULT);
|
||||||
gmk_add_function ("test-noexpand", func_test, 1, 1, GMK_FUNC_NOEXPAND);
|
gmk_add_function ("test-noexpand", func_test, 1, 1, GMK_FUNC_NOEXPAND);
|
||||||
gmk_add_function ("test-eval", func_test, 1, 1, GMK_FUNC_DEFAULT);
|
gmk_add_function ("test-eval", func_test, 1, 1, GMK_FUNC_DEFAULT);
|
||||||
gmk_add_function ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.", func_test, 0, 0, 0);
|
gmk_add_function ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.", func_test, 0, 0, 0);
|
||||||
|
|
||||||
if (getenv ("TESTAPI_VERBOSE"))
|
if (verbose)
|
||||||
|
{
|
||||||
printf ("testapi_gmk_setup\n");
|
printf ("testapi_gmk_setup\n");
|
||||||
|
|
||||||
|
if (verbose[0] == '2')
|
||||||
|
printf ("%s:%lu\n", floc->filenm, floc->lineno);
|
||||||
|
}
|
||||||
|
|
||||||
if (getenv ("TESTAPI_KEEP"))
|
if (getenv ("TESTAPI_KEEP"))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -201,6 +208,18 @@ force:;
|
|||||||
.PHONY: force
|
.PHONY: force
|
||||||
", '', "testapi_gmk_setup\nhello\n#MAKE#: 'all' is up to date.\n");
|
", '', "testapi_gmk_setup\nhello\n#MAKE#: 'all' is up to date.\n");
|
||||||
|
|
||||||
|
# sv 63100.
|
||||||
|
# Test that make supplies the correct floc when the shared object is loaded
|
||||||
|
# again.
|
||||||
|
$ENV{TESTAPI_VERBOSE} = 2;
|
||||||
|
run_make_test("
|
||||||
|
load testapi.so
|
||||||
|
$extra_loads
|
||||||
|
all:; \$(info \$(test-expand hello))
|
||||||
|
testapi.so: force; \$(info \$@)
|
||||||
|
force:;
|
||||||
|
.PHONY: force
|
||||||
|
", '', "testapi_gmk_setup\n#MAKEFILE#:2\ntestapi.so\ntestapi_gmk_setup\n#MAKEFILE#:2\nhello\n#MAKE#: 'all' is up to date.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
unlink(qw(testapi.c testapi.so)) unless $keep;
|
unlink(qw(testapi.c testapi.so)) unless $keep;
|
||||||
|
Loading…
Reference in New Issue
Block a user