xref: /illumos-gate/usr/src/test/util-tests/tests/ctf/test-reference.c (revision 987bce4514168c128e42feae3a7c308872fd4bea)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright (c) 2019, Joyent, Inc.
14  */
15 
16 /*
17  * Test the encoding of references to another type. Specifically the references
18  * that we generally care about are things like:
19  *
20  * o pointers
21  * o typedefs
22  * o const
23  * o volatile
24  * o restrict
25  */
26 
27 int a;
28 typedef int test_int_t;
29 test_int_t aa;
30 const short b;
31 volatile float c;
32 
33 int *d;
34 int **dd;
35 int ***ddd;
36 test_int_t *e;
37 const test_int_t *ce;
38 volatile test_int_t *ve;
39 volatile const test_int_t *cve;
40 int *const *f;
41 const char *const g;
42 
43 typedef int *const * foo_t;
44 const volatile foo_t *cvh;
45