8 /* Try to create a local of an opaque struct;
9 the API ought to complain. */
12 create_code (gcc_jit_context
*ctxt
, void *user_data
)
14 gcc_jit_type
*t_void
=
15 gcc_jit_context_get_type (ctxt
, GCC_JIT_TYPE_VOID
);
17 gcc_jit_struct
*t_opaque
=
18 gcc_jit_context_new_opaque_struct (ctxt
, NULL
, "opaque");
20 gcc_jit_function
*func
=
21 gcc_jit_context_new_function (ctxt
, NULL
,
22 GCC_JIT_FUNCTION_EXPORTED
,
28 (void)gcc_jit_function_new_local (func
, NULL
,
29 gcc_jit_struct_as_type (t_opaque
),
34 verify_code (gcc_jit_context
*ctxt
, gcc_jit_result
*result
)
36 CHECK_VALUE (result
, NULL
);
38 /* Verify that the correct error message was emitted. */
39 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt
),
40 "gcc_jit_function_new_local:"
41 " unknown size for local \"i\" (type: struct opaque)");