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-enum.c
+++ new/usr/src/test/util-tests/tests/ctf/check-enum.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 handle enums.
18 18 */
19 19
20 20 #include "check-common.h"
21 21
22 22 static check_symbol_t check_syms[] = {
23 23 { "ff6", "enum ff6" },
24 24 { "ff10", "ff10_t" },
25 25 { NULL }
26 26 };
27 27
28 28 static check_descent_t check_descent_ff6[] = {
29 29 { "enum ff6", CTF_K_ENUM },
30 30 { NULL }
31 31 };
32 32
33 33 static check_descent_t check_descent_ff10[] = {
34 34 { "ff10_t", CTF_K_TYPEDEF },
35 35 { "enum ff10", CTF_K_ENUM },
36 36 { NULL }
37 37 };
38 38
39 39 static check_descent_t check_descent_chrono[] = {
40 40 { "chrono_t", CTF_K_TYPEDEF },
41 41 { "enum chrono", CTF_K_ENUM },
42 42 { NULL }
43 43 };
44 44
45 45 static check_descent_test_t descents[] = {
46 46 { "ff10", check_descent_ff10 },
47 47 { "ff6", check_descent_ff6 },
48 48 { "trigger", check_descent_chrono },
49 49 { NULL }
50 50 };
51 51
52 52 static check_enum_t check_enum_ff6[] = {
53 53 { "TERRA", 0 },
54 54 { "LOCKE", 1 },
55 55 { "EDGAR", 2 },
56 56 { "SABIN", 3 },
57 57 { "CELES", 4 },
58 58 { "CYAN", 5 },
59 59 { "SHADOW", 6 },
60 60 { "GAU", 7 },
61 61 { "SETZER", 8 },
62 62 { "STRAGO", 9 },
63 63 { "RELM", 10 },
64 64 { "MOG", 11 },
65 65 { "GOGO", 12 },
66 66 { "UMARO", 13 },
67 67 { "LEO", 14 },
68 68 { "KEFKA", 15 },
69 69 { NULL }
70 70 };
71 71
72 72 static check_enum_t check_enum_ff10[] = {
73 73 { "TIDUS", -10 },
74 74 { "YUNA", 23 },
75 75 { "AURON", -34 },
76 76 { "WAKA", 52 },
77 77 { "LULU", INT32_MAX },
78 78 { "RIKKU", INT32_MIN },
79 79 { "KHIMARI", 0 },
80 80 { NULL }
81 81 };
82 82
83 83 static check_enum_t check_enum_chrono[] = {
84 84 { "CRONO", 0x1000 },
85 85 { "LUCCA", 0x2000 },
86 86 { "MARLE", 0x3000 },
87 87 { "FROG", 0x4000 },
88 88 { "ROBO", 0x5000 },
89 89 { "AYLA", 0x6000 },
90 90 { "MAGUS", 0x7000 },
91 91 { "SCHALA", 0x8000 },
92 92 { "LAVOS", 0x9000 },
93 93 { "BALTHAZAR", 0xa000 },
94 94 { NULL }
95 95 };
96 96
97 97 static check_enum_test_t enums[] = {
98 98 { "enum ff6", check_enum_ff6 },
99 99 { "enum ff10", check_enum_ff10 },
100 100 { "enum chrono", check_enum_chrono },
101 101 { NULL }
102 102 };
103 103
104 104 int
105 105 main(int argc, char *argv[])
106 106 {
107 107 int i, ret = 0;
108 108
109 109 if (argc < 2) {
110 110 errx(EXIT_FAILURE, "missing test files");
111 111 }
112 112
113 113 for (i = 1; i < argc; i++) {
114 114 ctf_file_t *fp;
115 115 uint_t d;
116 116
↓ open down ↓ |
93 lines elided |
↑ open up ↑ |
117 117 if ((fp = ctf_open(argv[i], &ret)) == NULL) {
118 118 warnx("failed to open %s: %s", argv[i],
119 119 ctf_errmsg(ret));
120 120 ret = EXIT_FAILURE;
121 121 continue;
122 122 }
123 123 if (!ctftest_check_symbols(fp, check_syms))
124 124 ret = EXIT_FAILURE;
125 125 for (d = 0; descents[d].cdt_sym != NULL; d++) {
126 126 if (!ctftest_check_descent(descents[d].cdt_sym, fp,
127 - descents[d].cdt_tests)) {
127 + descents[d].cdt_tests, B_FALSE)) {
128 128 ret = EXIT_FAILURE;
129 129 }
130 130 }
131 131
132 132 for (d = 0; enums[d].cet_type != NULL; d++) {
133 133 if (!ctftest_check_enum(enums[d].cet_type, fp,
134 134 enums[d].cet_tests)) {
135 135 ret = EXIT_FAILURE;
136 136 }
137 137 }
138 138 ctf_close(fp);
139 139 }
140 140
141 141 return (ret);
142 142
143 143 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX