8 /* Try to dereference a bit-field. */
11 create_code (gcc_jit_context
*ctxt
, void *user_data
)
13 /* Let's try to inject the equivalent of:
24 gcc_jit_type
*int_type
=
25 gcc_jit_context_get_type (ctxt
, GCC_JIT_TYPE_INT
);
27 gcc_jit_context_new_bitfield (ctxt
,
33 gcc_jit_context_new_bitfield (ctxt
,
38 gcc_jit_field
*fields
[] = {i
, j
};
39 gcc_jit_type
*struct_type
=
40 gcc_jit_struct_as_type (
41 gcc_jit_context_new_struct_type (ctxt
, NULL
, "bit_foo", 2, fields
));
43 gcc_jit_lvalue
*f_struct
=
44 gcc_jit_context_new_global (ctxt
,
46 GCC_JIT_GLOBAL_INTERNAL
,
50 gcc_jit_lvalue_get_address (
51 gcc_jit_lvalue_access_field (
59 verify_code (gcc_jit_context
*ctxt
, gcc_jit_result
*result
)
61 CHECK_VALUE (result
, NULL
);
63 /* Verify that the correct error message was emitted. */
64 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt
),
65 "cannot take address of bit-field");