Skip to content

Repository files navigation

Portable Testsuite to check a C / C++ Compiler and standard runtime libraries

Many compiler and the related standard libraries provide tests, but they are not easy usable as portable/standalone conformance check for other compiler or for other runtime library implementations.

Goals for stdtests

  • A reusable license

  • Only needs a Compiler and a posix shell to run the testsuite

  • Portable: Works on many systems with many compiler and runtime libraries

  • Check C Compiler and the C Runtime library

  • Check the POSIX Runtime library

  • Check C++ Compiler and the C++ Runtime library

  • Create a nice Table from multiple Results

  • Currently, only headers are checked for availability during configure

Expected usecase

  • Extract the testsuite
  • configure the testsuite to test a compiler / runtime library for a given standard
  • make: run the testsuite and generate a result file
  • make table: generate a table for multiple results

Expected usage

  • std: newest
  • Compiler: tcc
  • runtime-library: system-default
mkdir results
cd results
CC=tcc ../configure --disable-c++
make
  • Now there should be an document with the results of the current test

Portability

  • Current tested environments

    Target OStested Compiler
    Linuxtcc / gcc / g++ / owcc / clang / zig cc / zig c++
    Windowsx86_64-win32-tcc / x86_64-w64-mingw32-gcc / x86_64-w64-mingw32-g++
  • Hints / Links for later use:

    • With many years delay, a command line switch arrived in MSVC 2015 Update 3 for selecting the c++ version

Checking C Compiler and the C Runtime library

STDC2yC23C17C11C99C95 (C90+AMD1)C89/C90 / ANSI-C

Checking POSIX Runtime library

Currently, POSIX.1-2024 ist referenced. Older versions will follow.

Checking C++ Compiler and the C++ Runtime library

STDC++2cC++23C++20C++17C++14C++11C++03C++98

Some examples of other tables with Features or Test-Results

Some links to compiler / library tests

NameURL
clangtest top dir
gcctest top dir
mcpppreprocessor
musllibc-tests
glibclibc

C Reference Documentation

Available C Standards

Released C Standards (Click Arrow to expand)
std__STDC_VERSION__Latest DraftRelease
C2yN/AN3550N/A
C23202311N3096ISO/IEC 9899:2024
C17201710N2176ISO/IEC 9899:2018
C11201112N1570ISO/IEC 9899:2011
C99199901N1256ISO/IEC 9899:1999
C95199409c89_na1: c94ISO/IEC 9899:1990/AMD1:1995
C90not definedFIPS 160ISO/IEC 9899:1990
C89not definedc89 draftANSI X3.159-1989

POSIX Reference Documentation

POSIX (Portable Operating System Interface) specifies many parts of an Operating System.

Interesting for this project is the API part of the Base Specification.

Available POSIX Standards

Released POSIX Standards (Click Arrow to expand)

The Open Group Base Specification is also released as the Single UNIX Specification and also released as the ISO/IEC 9945-1 standard.

_POSIX_VERSION_XOPEN_VERSIONThe Open Group Base SpecificationViewDownloads
202405800POSIX.1-2024, Issue 8, 2024 EditionView onlinesusv5
200809700POSIX.1-2017, Issue 7, 2018 EditionView onlinesusv4-2018
200809700POSIX.1-2008, Issue 7, 2016 EditionView onlinesusv4tc2
200809700POSIX.1-2008, Issue 7, 2013 EditionView onlinesusv4tc1
200809700POSIX.1-2008, Issue 7, 2008 EditionView onlinesusv4
200112600POSIX.1-2001, Issue 6, 2004 EditionView onlinesusv3
199506POSIX.1-1996
199009POSIX.1-1990FIPS 151-2
198808POSIX.1-1988FIPS 151-1

C++ Reference Documentation

Available C++ Standards

Released C++ Standards (Click Arrow to expand)
std__cplusplusLatest DraftRelease
C++26N/AN5014N/A
C++23202302N4950ISO/IEC 14882:2023
C++20202002N4849ISO/IEC 14882:2020
C++17201703N4659ISO/IEC 14882:2017
C++14201402N3797ISO/IEC 14882:2014
C++11201103N3242ISO/IEC 14882:2011
C++03200300c++03 finalISO/IEC 14882:2003
C++98199711nr. unknownISO/IEC 14882:1998

Maintainer Mode hints

  • use 'bootstrap' to regenerate the build system files
  • use 'configure' with "--enable-maintainer-mode" to rebuild all programs all tests groups are enabled by default:
    • C
    • C++ (alias names: cxx / cplusplus)
    • posix
    • libc
    • libc++ (alias name: libcxx)

About

C / C++ Compiler and standard library Conformance Test Suite

Topics

Resources

Stars

18 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages