gcc/gcc/testsuite/jit.dg
David Malcolm 9376dd63e6 Support embedding the driver in-process within libgccjit
gcc/ChangeLog:
	* gcc-main.c (main): Add params to driver ctor.
	* gcc.c (class env_manager): New.
	(env): New global.
	(env_manager::init): New.
	(env_manager::get): New.
	(env_manager::xput): New.
	(env_manager::restore): New.
	Poison getenv and putenv.
	(DEFAULT_TARGET_SYSTEM_ROOT): New.
	(target_system_root): Update initialization to use
	DEFAULT_TARGET_SYSTEM_ROOT.
	(struct spec_list): Add field "default_ptr".
	(INIT_STATIC_SPEC): Initialize new field "default_ptr".
	(init_spec): Likewise.
	(set_spec): Clear field "default_ptr".
	(read_specs): Free "spec" and "buffer".
	(xputenv): Reimplement in terms of env_manager.
	(process_command): Replace ::getenv calls with calls to the
	env_manager singleton.
	(process_brace_body): Free string in three places.
	(driver::driver): New.
	(driver::~driver): New.
	(used_arg): Convert from a function to...
	(class used_arg_t): ...this class, and...
	(used_arg): ...this new global instance.
	(used_arg_t::finalize): New function.
	(getenv_spec_function): Add "const" to local "value".  Replace
	::getenv call with call to the env_manager singleton.
	(path_prefix_reset): New function.
	(driver::finalize): New function.
	* gcc.h (driver::driver): New.
	(driver::~driver): New.
	(driver::finalize): New.

gcc/jit/ChangeLog:
	* docs/cp/topics/contexts.rst
	(gccjit::context::set_bool_use_external_driver): New.
	* docs/internals/test-hello-world.exe.log.txt: Update.
	* docs/topics/compatibility.rst (LIBGCCJIT_ABI_5): New.
	* docs/topics/contexts.rst
	(gcc_jit_context_set_bool_use_external_driver): New.
	* jit-common.h (enum inner_bool_option): Add
	INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
	* jit-playback.c (gcc_driver_name): New global.
	(gcc:jit::playback::context::invoke_driver): Split out second
	half into...
	(gcc::jit::playback::context::invoke_embedded_driver): ...this new
	function, and...
	(gcc::jit::playback::context::invoke_external_driver): ...this new
	function.
	* jit-playback.h
	(gcc::jit::playback::context::get_inner_bool_option): New.
	(gcc::jit::playback::context::invoke_embedded_driver): New.
	(gcc::jit::playback::context::invoke_external_driver): New.
	* jit-recording.c (inner_bool_option_reproducer_strings):
	Add entry for INNER_BOOL_OPTION_USE_EXTERNAL_DRIVER.
	* libgccjit++.h
	(gccjit::context::set_bool_use_external_driver): New.
	* libgccjit.c (gcc_jit_context_set_bool_use_external_driver): New.
	* libgccjit.h (gcc_jit_context_set_bool_use_external_driver): New.
	(LIBGCCJIT_HAVE_gcc_jit_context_set_bool_use_external_driver):
	New.
	* libgccjit.map (LIBGCCJIT_ABI_5): New.
	* notes.txt: Show invocation of embedded copy of driver.
	* docs/internals/test-hello-world.exe.log.txt: Update

gcc/testsuite/ChangeLog:
	* jit.dg/test-error-pr63969-missing-driver.c: Add call to
	gcc_jit_context_set_bool_use_external_driver.

From-SVN: r227188
2015-08-25 20:25:05 +00:00
..
all-non-failing-tests.h PR jit/66779: fix segfault 2015-07-07 19:22:01 +00:00
create-code-for-hello-world-executable.h
harness.h jit: add test-benchmark.c 2015-05-06 20:13:50 +00:00
jit.exp jit: add test-benchmark.c 2015-05-06 20:13:50 +00:00
test-accessing-struct.c
test-accessing-union.c jit: document union types 2015-07-01 12:41:18 +00:00
test-arith-overflow.c
test-array-as-pointer.c
test-arrays.c
test-benchmark.c jit.dg/test-benchmark.c: add a summary of timings 2015-08-06 19:05:52 +00:00
test-calling-external-function.c
test-calling-function-ptr.c
test-combination.c
test-compile-to-assembler.c
test-compile-to-dynamic-library.c
test-compile-to-executable.c
test-compile-to-object.c
test-compound-assignment.c jit: Add a test for compound assignment 2015-06-16 19:52:37 +00:00
test-constants.c
test-debug-strings.c PR jit/66539: Add parentheses as needed to gcc_jit_object_get_debug_string 2015-06-16 18:13:44 +00:00
test-dot-product.c
test-empty.c
test-error-adding-to-terminated-block.c
test-error-array-as-pointer.c
test-error-bad-cast.c
test-error-block-in-wrong-function.c
test-error-call-through-ptr-with-mismatching-args.c
test-error-call-through-ptr-with-non-function.c
test-error-call-through-ptr-with-non-pointer.c
test-error-call-through-ptr-with-not-enough-args.c
test-error-call-through-ptr-with-too-many-args.c
test-error-call-with-mismatching-args.c
test-error-call-with-not-enough-args.c
test-error-call-with-too-many-args.c
test-error-dereference-field-of-non-pointer.c
test-error-dereference-read-of-non-pointer.c
test-error-dereferencing-void-ptr.c
test-error-gcc_jit_block_end_with_switch-NULL-case.c Fix comments in a jit testcase 2015-07-08 14:55:33 +00:00
test-error-gcc_jit_block_end_with_switch-mismatching-case-type.c jit: add switch statements 2015-06-30 20:39:50 +00:00
test-error-gcc_jit_block_end_with_switch-overlapping-ranges.c jit: add switch statements 2015-06-30 20:39:50 +00:00
test-error-gcc_jit_context_new_case-non-const-label.c jit: add switch statements 2015-06-30 20:39:50 +00:00
test-error-gcc_jit_context_new_case-non-integer-type.c jit: add switch statements 2015-06-30 20:39:50 +00:00
test-error-gcc_jit_context_new_case-reversed-endpoints.c jit: add switch statements 2015-06-30 20:39:50 +00:00
test-error-gcc_jit_context_new_field-opaque-struct.c PR jit/66783: improve error messages 2015-07-08 14:41:59 +00:00
test-error-gcc_jit_context_new_global-opaque-struct.c PR jit/66783: improve error messages 2015-07-08 14:41:59 +00:00
test-error-gcc_jit_function_new_local-opaque-struct.c PR jit/66783: improve error messages 2015-07-08 14:41:59 +00:00
test-error-gcc_jit_lvalue_access_field-wrong-struct.c jit: Add missing type-checking to gcc_jit_{l|r}value_access_field 2015-06-17 16:04:18 +00:00
test-error-gcc_jit_rvalue_access_field-wrong-struct.c jit: Add missing type-checking to gcc_jit_{l|r}value_access_field 2015-06-17 16:04:18 +00:00
test-error-gcc_jit_rvalue_dereference_field-wrong-struct.c jit: Add missing type-checking to gcc_jit_{l|r}value_access_field 2015-06-17 16:04:18 +00:00
test-error-gcc_jit_timer_pop-mismatch.c Refactoring of timevar API 2015-08-03 20:14:21 +00:00
test-error-gcc_jit_timer_pop-too-many.c Refactoring of timevar API 2015-08-03 20:14:21 +00:00
test-error-get-type-bad-enum.c
test-error-index-not-a-numeric-type.c
test-error-local-used-from-other-function.c
test-error-mismatching-types-in-assignment-op.c
test-error-mismatching-types-in-assignment.c
test-error-mismatching-types-in-call.c PR jit/66783: prevent use of opaque structs 2015-07-07 19:29:58 +00:00
test-error-missing-return.c
test-error-new-binary-op-bad-op.c
test-error-new-function-bad-kind.c
test-error-new-unary-op-bad-op.c
test-error-null-passed-to-api.c
test-error-param-reuse.c
test-error-param-sharing.c
test-error-param-used-from-other-function.c
test-error-param-used-without-a-function.c
test-error-pr63969-missing-driver.c Support embedding the driver in-process within libgccjit 2015-08-25 20:25:05 +00:00
test-error-return-within-void-function.c
test-error-unreachable-block.c
test-error-unrecognized-dump.c
test-error-unterminated-block.c
test-error-value-not-a-numeric-type.c
test-expressions.c
test-extra-options.c PR jit/66628: add gcc_jit_context_add_command_line_option 2015-06-30 19:27:19 +00:00
test-factorial.c
test-fibonacci.c
test-functions.c
test-fuzzer.c
test-hello-world.c
test-linked-list.c
test-long-names.c
test-nested-contexts.c
test-nested-loops.c
test-operator-overloading.cc
test-pr66700-observing-write-through-ptr.c PR jit/66700: set TREE_ADDRESSABLE when building an ADDR_EXPR 2015-07-01 12:50:50 +00:00
test-pr66779.c PR jit/66779: fix segfault 2015-07-07 19:22:01 +00:00
test-quadratic.c PR jit/66539: Add parentheses as needed to gcc_jit_object_get_debug_string 2015-06-16 18:13:44 +00:00
test-quadratic.cc
test-reading-struct.c
test-string-literal.c
test-sum-of-squares.c
test-switch.c jit: add switch statements 2015-06-30 20:39:50 +00:00
test-switch.cc jit: add switch statements 2015-06-30 20:39:50 +00:00
test-threads.c
test-types.c
test-using-global.c
test-validly-unreachable-block.c PR jit/66546: Add gcc_jit_context_set_bool_allow_unreachable_blocks 2015-06-30 19:38:12 +00:00
test-volatile.c
verify-dynamic-library.c