1 /* PR jit/63969: libgccjit would segfault inside gcc_jit_context_compile
2 if the driver wasn't found on PATH if GCC_JIT_STR_OPTION_PROGNAME was
13 create_code (gcc_jit_context
*ctxt
, void *user_data
)
15 /* Create nothing within the context. */
17 /* harness.h's set_options has set a sane value for
18 GCC_JIT_STR_OPTION_PROGNAME, but PR jit/63969 only segfaulted if it's
22 gcc_jit_context_set_str_option (ctxt
, GCC_JIT_STR_OPTION_PROGNAME
, NULL
);
24 /* By default, we use an embedded copy of the driver.
25 Opt-in to using an external copy of the driver. */
26 gcc_jit_context_set_bool_use_external_driver (ctxt
, 1);
28 /* Break PATH, so that the driver can't be found
29 by gcc::jit::playback::context::compile ()
30 within gcc_jit_context_compile. */
35 verify_code (gcc_jit_context
*ctxt
, gcc_jit_result
*result
)
37 CHECK_VALUE (result
, NULL
);
39 /* Verify that a sane error message was emitted. */
40 CHECK_STRING_STARTS_WITH (gcc_jit_context_get_first_error (ctxt
),
41 "error invoking gcc driver");