xref: /illumos-gate/usr/src/test/util-tests/tests/ctf/test-qualifiers.c (revision 78801af7286cd73dbc996d470f789e75993cf15d)
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 2019, Joyent, Inc.
14  */
15 
16 /*
17  * Make sure that we're encoding qualifiers correctly.
18  */
19 
20 const union const_union {
21 	int i;
22 } const_union_array[5];
23 
24 const struct const_struct {
25 	int i;
26 } const_struct_array[7];
27 
28 volatile struct volatile_struct {
29 	int i;
30 } volatile_struct_array[9];
31 
32 const int c_int_array[11];
33 const volatile int cv_int_array[13];
34 volatile const int vc_int_array[15];
35 volatile int const vc_int_array2[17];
36 
37 const int c_2d_array[4][2];
38 const volatile int cv_3d_array[3][2][1];
39 
40 const int *ptr_to_const_int;
41 int * const const_ptr_to_int;
42 const int * const const_ptr_to_const_int;
43