1*5bb525f4SRobert Mustacchi#
2*5bb525f4SRobert Mustacchi# This file and its contents are supplied under the terms of the
3*5bb525f4SRobert Mustacchi# Common Development and Distribution License ("CDDL"), version 1.0.
4*5bb525f4SRobert Mustacchi# You may only use this file in accordance with the terms of version
5*5bb525f4SRobert Mustacchi# 1.0 of the CDDL.
6*5bb525f4SRobert Mustacchi#
7*5bb525f4SRobert Mustacchi# A full copy of the text of the CDDL should have accompanied this
8*5bb525f4SRobert Mustacchi# source.  A copy of the CDDL is also available via the Internet at
9*5bb525f4SRobert Mustacchi# http://www.illumos.org/license/CDDL.
10*5bb525f4SRobert Mustacchi#
11*5bb525f4SRobert Mustacchi
12*5bb525f4SRobert Mustacchi#
13*5bb525f4SRobert Mustacchi# Copyright (c) 2019, Joyent, Inc.
14*5bb525f4SRobert Mustacchi#
15*5bb525f4SRobert Mustacchi
16*5bb525f4SRobert MustacchiCTF Tests
17*5bb525f4SRobert Mustacchi---------
18*5bb525f4SRobert Mustacchi
19*5bb525f4SRobert MustacchiThis directory contains a series of tests for the Compact C Type Format
20*5bb525f4SRobert Mustacchi(CTF). For each test program, there is a corresponding C program that
21*5bb525f4SRobert Mustacchigoes through and checks the CTF for various aspects. Due to the fact
22*5bb525f4SRobert Mustacchithat the CTF generated by compilers can change slightly, the tests have
23*5bb525f4SRobert Mustacchibeen designed this way to try and make it work with as wide a variety of
24*5bb525f4SRobert Mustacchiprograms as possible.
25*5bb525f4SRobert Mustacchi
26*5bb525f4SRobert MustacchiThe test suite requires the following:
27*5bb525f4SRobert Mustacchi
28*5bb525f4SRobert Mustacchi1. make
29*5bb525f4SRobert Mustacchi2. C Compiler (defaults to gcc)
30*5bb525f4SRobert Mustacchi3. A copy of ctfconvert
31*5bb525f4SRobert Mustacchi
32*5bb525f4SRobert MustacchiThe source for a given program will be compiled on the target system and
33*5bb525f4SRobert Mustacchithen converted. This allows us to try the CTF tools against a wide
34*5bb525f4SRobert Mustacchivariety of different compilers or DWARF standards.
35*5bb525f4SRobert Mustacchi
36*5bb525f4SRobert MustacchiCaveats
37*5bb525f4SRobert Mustacchi-------
38*5bb525f4SRobert Mustacchi
39*5bb525f4SRobert MustacchiRight now the tests only pass when using gcc 4.x. The following are
40*5bb525f4SRobert Mustacchiknown issues with the tests:
41*5bb525f4SRobert Mustacchi
42*5bb525f4SRobert Mustacchi1. gcc7+ generates some different DWARF ordering, which causes some
43*5bb525f4SRobert Mustacchitests to spuriously fail. These tests should be improved.
44*5bb525f4SRobert Mustacchi
45*5bb525f4SRobert Mustacchi2. There are cases where gcc7+ appears to attribute things as being const
46*5bb525f4SRobert Mustacchitwice in DWARF which throw off the tests. The CTF tools likely should
47*5bb525f4SRobert Mustacchiwork around this if we confirm that this is intentional.
48*5bb525f4SRobert Mustacchi
49*5bb525f4SRobert Mustacchi3. Many tests will cause clang not to emit DWARF information because
50*5bb525f4SRobert Mustacchiclang infers that they cannot be used. The tests should be cleaned up in
51*5bb525f4SRobert Mustacchithese cases.
52*5bb525f4SRobert Mustacchi
53*5bb525f4SRobert Mustacchi4. clang generated DWARF can confuse the CTF tools. The tools should be
54*5bb525f4SRobert Mustacchifixed and additional regression tests should be added.
55