annotate gcc/testsuite/jit.dg/test-error-get-type-bad-enum.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 #include <stdlib.h>
kono
parents:
diff changeset
2 #include <stdio.h>
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 #include "libgccjit.h"
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 #include "harness.h"
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 void
kono
parents:
diff changeset
9 create_code (gcc_jit_context *ctxt, void *user_data)
kono
parents:
diff changeset
10 {
kono
parents:
diff changeset
11 /* Trigger an API error by passing bad data. */
kono
parents:
diff changeset
12 gcc_jit_context_get_type (ctxt, 42);
kono
parents:
diff changeset
13 }
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 void
kono
parents:
diff changeset
16 verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
kono
parents:
diff changeset
17 {
kono
parents:
diff changeset
18 /* Ensure that the bad API usage prevents the API giving a bogus
kono
parents:
diff changeset
19 result back. */
kono
parents:
diff changeset
20 CHECK_VALUE (result, NULL);
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 /* Verify that the correct error message was emitted. */
kono
parents:
diff changeset
23 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt),
kono
parents:
diff changeset
24 ("gcc_jit_context_get_type:"
kono
parents:
diff changeset
25 " unrecognized value for enum gcc_jit_types: 42"));
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27