# # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2019, Joyent, Inc. # CTF Tests --------- This directory contains a series of tests for the Compact C Type Format (CTF). For each test program, there is a corresponding C program that goes through and checks the CTF for various aspects. Due to the fact that the CTF generated by compilers can change slightly, the tests have been designed this way to try and make it work with as wide a variety of programs as possible. The test suite requires the following: 1. make 2. C Compiler (defaults to gcc) 3. A copy of ctfconvert The source for a given program will be compiled on the target system and then converted. This allows us to try the CTF tools against a wide variety of different compilers or DWARF standards. Caveats ------- Right now the tests only pass when using gcc 4.x. The following are known issues with the tests: 1. gcc7+ generates some different DWARF ordering, which causes some tests to spuriously fail. These tests should be improved. 2. There are cases where gcc7+ appears to attribute things as being const twice in DWARF which throw off the tests. The CTF tools likely should work around this if we confirm that this is intentional. 3. Many tests will cause clang not to emit DWARF information because clang infers that they cannot be used. The tests should be cleaned up in these cases. 4. clang generated DWARF can confuse the CTF tools. The tools should be fixed and additional regression tests should be added.