Print this page
10823 should ignore DW_TAG_subprogram with DW_AT_declaration tags
10824 GCC7-derived CTF can double qualifiers on arrays
10825 ctfdump -c drops last type
10826 ctfdump -c goes off the rails with a missing parent
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Jason King <jason.king@joyent.com>
Approved by: Jerry Jelinek <jerry.jelinek@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/test/util-tests/tests/ctf/check-array.c
+++ new/usr/src/test/util-tests/tests/ctf/check-array.c
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 4 * You may only use this file in accordance with the terms of version
5 5 * 1.0 of the CDDL.
6 6 *
7 7 * A full copy of the text of the CDDL should have accompanied this
8 8 * source. A copy of the CDDL is also available via the Internet at
9 9 * http://www.illumos.org/license/CDDL.
10 10 */
11 11
12 12 /*
13 - * Copyright (c) 2019, Joyent, Inc.
13 + * Copyright 2019, Joyent, Inc.
14 14 */
15 15
16 16 /*
17 17 * Check that we properly generate basic nested arrays.
18 18 */
19 19
20 20 #include "check-common.h"
21 21
22 22 static check_number_t check_base[] = {
23 23 { "char", CTF_K_INTEGER, CTF_INT_SIGNED | CTF_INT_CHAR, 0, 8 },
24 24 { "int", CTF_K_INTEGER, CTF_INT_SIGNED, 0, 32 },
25 25 { "double", CTF_K_FLOAT, CTF_FP_DOUBLE, 0, 64 },
26 26 { NULL }
27 27 };
28 28
29 29 static check_symbol_t check_syms[] = {
30 30 { "a", "int [3]" },
31 31 { "b", "double [42]" },
32 32 { "c", "const char *[2]" },
33 33 { "d", "int [4][5]" },
34 34 { "e", "int [4][5][6]" },
35 35 { "f", "int [4][5][6][7]" },
36 36 { "g", "int [4][5][6][7][8]" },
37 37 { "h", "int [4][5][6][7][8][9]" },
38 38 { "i", "int [4][5][6][7][8][9][10]" },
39 39 { NULL }
40 40 };
41 41
42 42 static check_descent_t check_array_a[] = {
43 43 { "int [3]", CTF_K_ARRAY, "int", 3 },
44 44 { "int", CTF_K_INTEGER },
45 45 { NULL }
46 46 };
47 47
48 48 static check_descent_t check_array_b[] = {
49 49 { "double [42]", CTF_K_ARRAY, "double", 42 },
50 50 { "double", CTF_K_FLOAT },
51 51 { NULL }
52 52 };
53 53
54 54 static check_descent_t check_array_c[] = {
55 55 { "const char *[2]", CTF_K_ARRAY, "const char *", 2 },
56 56 { "const char *", CTF_K_POINTER },
57 57 { "const char", CTF_K_CONST },
58 58 { "char", CTF_K_INTEGER },
59 59 { NULL }
60 60 };
61 61
62 62 static check_descent_t check_array_i[] = {
63 63 { "int [4][5][6][7][8][9][10]", CTF_K_ARRAY,
64 64 "int [5][6][7][8][9][10]", 4 },
65 65 { "int [5][6][7][8][9][10]", CTF_K_ARRAY, "int [6][7][8][9][10]", 5 },
66 66 { "int [6][7][8][9][10]", CTF_K_ARRAY, "int [7][8][9][10]", 6 },
67 67 { "int [7][8][9][10]", CTF_K_ARRAY, "int [8][9][10]", 7 },
68 68 { "int [8][9][10]", CTF_K_ARRAY, "int [9][10]", 8 },
69 69 { "int [9][10]", CTF_K_ARRAY, "int [10]", 9 },
70 70 { "int [10]", CTF_K_ARRAY, "int", 10 },
71 71 { "int", CTF_K_INTEGER },
72 72 { NULL },
73 73 };
74 74
75 75 static check_descent_test_t descents[] = {
76 76 { "a", check_array_a },
77 77 { "b", check_array_b },
78 78 { "c", check_array_c },
79 79 { "i", check_array_i },
80 80 { NULL }
81 81 };
82 82
83 83 int
84 84 main(int argc, char *argv[])
85 85 {
86 86 int i, ret = 0;
87 87
88 88 if (argc < 2) {
89 89 errx(EXIT_FAILURE, "missing test files");
90 90 }
91 91
92 92 for (i = 1; i < argc; i++) {
93 93 ctf_file_t *fp;
94 94 uint_t d;
95 95
96 96 if ((fp = ctf_open(argv[i], &ret)) == NULL) {
97 97 warnx("failed to open %s: %s", argv[i],
↓ open down ↓ |
74 lines elided |
↑ open up ↑ |
98 98 ctf_errmsg(ret));
99 99 ret = EXIT_FAILURE;
100 100 continue;
101 101 }
102 102 if (!ctftest_check_numbers(fp, check_base))
103 103 ret = EXIT_FAILURE;
104 104 if (!ctftest_check_symbols(fp, check_syms))
105 105 ret = EXIT_FAILURE;
106 106 for (d = 0; descents[d].cdt_sym != NULL; d++) {
107 107 if (!ctftest_check_descent(descents[d].cdt_sym, fp,
108 - descents[d].cdt_tests)) {
108 + descents[d].cdt_tests, B_FALSE)) {
109 109 ret = EXIT_FAILURE;
110 110 }
111 111 }
112 112 ctf_close(fp);
113 113 }
114 114
115 115 return (ret);
116 116 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX