8 /* Try to create a global of an opaque struct;
9 the API ought to complain. */
12 create_code (gcc_jit_context
*ctxt
, void *user_data
)
14 gcc_jit_struct
*t_opaque
=
15 gcc_jit_context_new_opaque_struct (ctxt
, NULL
, "opaque");
17 (void)gcc_jit_context_new_global (ctxt
, NULL
,
18 GCC_JIT_GLOBAL_EXPORTED
,
19 gcc_jit_struct_as_type (t_opaque
),
20 "instance_of_opaque");
24 verify_code (gcc_jit_context
*ctxt
, gcc_jit_result
*result
)
26 CHECK_VALUE (result
, NULL
);
28 /* Verify that the correct error message was emitted. */
29 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt
),
30 "gcc_jit_context_new_global:"
31 " unknown size for global \"instance_of_opaque\" (type: struct opaque)");