9 create_code (gcc_jit_context
*ctxt
, void *user_data
)
11 /* Let's try to access an array at an index that isn't of a numeric
12 type and verify that the API complains about the bad type.
14 gcc_jit_rvalue
*string
=
15 gcc_jit_context_new_string_literal (ctxt
,
18 (void)gcc_jit_context_new_array_access (
21 string
/* index, not of numeric type */);
25 verify_code (gcc_jit_context
*ctxt
, gcc_jit_result
*result
)
27 CHECK_VALUE (result
, NULL
);
29 /* Verify that the correct error message was emitted. */
30 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt
),
31 "gcc_jit_context_new_array_access:"
32 " index: \"hello world\" (type: const char *)"
33 " is not of numeric type");