Debian Codegraph @

gcc/testsuite/jit.dg/test-pointer_size.c

raw
1 /* { dg-do compile { target x86_64-*-* } } */
2
3 #include <assert.h>
4 #include "libgccjit.h"
5
6 #include "harness.h"
7
8 void
9 create_code (gcc_jit_context *ctxt, void *user_data)
10 {}
11
12 void
13 verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
14 {
15 gcc_jit_type *int_type =
16 gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT);
17 gcc_jit_type *int_ptr_type = gcc_jit_type_get_pointer (int_type);
18
19 int int_ptr_size = gcc_jit_type_get_size (int_ptr_type);
20 CHECK_VALUE (int_ptr_size, 8);
21
22 gcc_jit_type *void_type =
23 gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_VOID);
24 gcc_jit_type *void_ptr_type = gcc_jit_type_get_pointer (void_type);
25
26 CHECK_VALUE (int_ptr_size, gcc_jit_type_get_size (void_ptr_type));
27 }