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 (c) 2019, Joyent, Inc.
  14 #
  15 
  16 CTF Tests
  17 ---------
  18 
  19 This directory contains a series of tests for the Compact C Type Format
  20 (CTF). For each test program, there is a corresponding C program that
  21 goes through and checks the CTF for various aspects. Due to the fact
  22 that the CTF generated by compilers can change slightly, the tests have
  23 been designed this way to try and make it work with as wide a variety of
  24 programs as possible.
  25 
  26 The test suite requires the following:
  27 
  28 1. make
  29 2. C Compiler (defaults to gcc)
  30 3. A copy of ctfconvert
  31 
  32 The source for a given program will be compiled on the target system and
  33 then converted. This allows us to try the CTF tools against a wide
  34 variety of different compilers or DWARF standards.
  35 
  36 Caveats
  37 -------
  38 
  39 Right now the tests only pass when using gcc 4.x. The following are
  40 known issues with the tests:
  41 
  42 1. gcc7+ generates some different DWARF ordering, which causes some
  43 tests to spuriously fail. These tests should be improved.
  44 
  45 2. There are cases where gcc7+ appears to attribute things as being const
  46 twice in DWARF which throw off the tests. The CTF tools likely should
  47 work around this if we confirm that this is intentional.
  48 
  49 3. Many tests will cause clang not to emit DWARF information because
  50 clang infers that they cannot be used. The tests should be cleaned up in
  51 these cases.
  52 
  53 4. clang generated DWARF can confuse the CTF tools. The tools should be
  54 fixed and additional regression tests should be added.