9 create_code (gcc_jit_context
*ctxt
, void *user_data
)
11 /* Trigger an API error by passing bad data. */
12 gcc_jit_context_new_function (ctxt
, NULL
,
13 GCC_JIT_FUNCTION_EXPORTED
,
14 NULL
, /* error: this must be non-NULL */
21 verify_code (gcc_jit_context
*ctxt
, gcc_jit_result
*result
)
23 /* Ensure that the bad API usage prevents the API giving a bogus
25 CHECK_VALUE (result
, NULL
);
27 /* Verify that the correct error message was emitted. */
28 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt
),
29 "gcc_jit_context_new_function: NULL return_type");
30 CHECK_STRING_VALUE (gcc_jit_context_get_last_error (ctxt
),
31 "gcc_jit_context_new_function: NULL return_type");