mesa/src/amd/compiler/tests
Rhys Perry 7bfaeaa590 aco: pass -fno-exceptions and -fno-rtti
We don't use exceptions or RTTI at all, so pass this flag to the compiler
to allow it to create better code.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6315>
2020-09-15 14:36:57 +00:00
..
check_output.py
framework.h
glsl_scraper.py aco: add framework for testing isel and integration tests 2020-07-30 16:13:08 +00:00
helpers.cpp aco: rework the way various compilation/validation errors are reported 2020-08-20 08:15:06 +02:00
helpers.h aco: add framework for testing isel and integration tests 2020-07-30 16:13:08 +00:00
main.cpp
meson.build aco: pass -fno-exceptions and -fno-rtti 2020-09-15 14:36:57 +00:00
README.md
test_assembler.cpp aco/tests: add tests for long jumps 2020-08-26 13:26:58 +00:00
test_isel.cpp aco: add framework for testing isel and integration tests 2020-07-30 16:13:08 +00:00
test_optimizer.cpp
test_tests.cpp
test_to_hw_instr.cpp aco: add GFX6/7 subdword lowering tests 2020-07-30 16:13:08 +00:00

Tests are wrapped in a BEGIN_TEST/END_TEST and write data to the output file pointer. Tests have checks against the output. They are single line comments prefixed with certain characters:

  • ! fails the test if the current line does not match the pattern
  • >> skips to the first line which matches the pattern, or fails the test if there is none
  • ; executes python code to extend the pattern syntax by inserting functions into the variable dictionary, fail the test, insert more checks or consume characters from the output

Before this prefix, there can be a ~ to only perform the check for certain variants (a regex directly following the ~ is used).

Pattern Syntax

Patterns can define variables which can be accessed in both python code and the pattern itself. These are useful for readability or dealing with unstable identifiers in the output. Variable identifiers are sequences of digits, ascii letters or _ (though they cannot start with a digit).

  • \ can be used to match the following literal character without interpreting it.
  • Most characters expect the same characters in the output.
  • A sequence of spaces in the pattern expects a sequence of spaces or tabs in the output.
  • A # in the pattern expects an unsigned integer in the output. The # can be followed by an identifier to store the integer in a variable.
  • A $ in the pattern stores the output until the first whitespace character into a variable.
  • A % in the pattern followed by an identifier is the same as a # but it expects a % before the integer in the output. It basically matches a ACO temporary.
  • A @ calls a variable as a function. It can be followed by an argument string wrapped in ( and ).