9 create_code (gcc_jit_context
*ctxt
, void *user_data
)
11 /* Verify that we get an error (rather than a crash)
12 if the client code reuses a gcc_jit_param * within
14 gcc_jit_type
*void_type
=
15 gcc_jit_context_get_type (ctxt
, GCC_JIT_TYPE_VOID
);
16 gcc_jit_type
*int_type
=
17 gcc_jit_context_get_type (ctxt
, GCC_JIT_TYPE_INT
);
20 gcc_jit_param
*param
=
21 gcc_jit_context_new_param (ctxt
, NULL
, int_type
, "i");
23 /* Try to use it twice when creating "fn". */
24 gcc_jit_param
*params
[2];
28 gcc_jit_context_new_function (ctxt
, NULL
,
29 GCC_JIT_FUNCTION_IMPORTED
,
37 verify_code (gcc_jit_context
*ctxt
, gcc_jit_result
*result
)
39 CHECK_VALUE (result
, NULL
);
41 /* Verify that the correct error message was emitted. */
42 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt
),
43 ("gcc_jit_context_new_function:"
44 " parameter i (type: int)"
45 " is used more than once when creating function"