Re-reapply "[Dexter] Remove builder from Dexter"

This patch makes a further attempt to fix the tests broken by the
previous revision by ensuring that the command line for the modified
Dexter tests use -std=gnu++11, in keeping with the old build script.

This reverts commit 5647f2908de90fe07b0805e988cd2e91a1751928.
This commit is contained in:
Stephen Tozer 2023-09-05 16:04:53 +01:00
parent cd8fe1dbcb
commit 45a40c1639
130 changed files with 287 additions and 686 deletions

View File

@ -1,9 +1,9 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
//
// RUN: %clang -std=gnu++11 -O0 -g -lstdc++ %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" \
// RUN: --ldflags="-lstdc++" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
// Radar 8945514
class SVal {

View File

@ -8,10 +8,9 @@
// lldb-8, even outside of dexter, will sometimes trigger an asan fault in
// the debugged process and generally freak out.
// RUN: %clang -std=gnu++11 -O1 -glldb -fsanitize=address -arch x86_64 %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-O1 -glldb -fsanitize=address -arch x86_64" \
// RUN: --ldflags="-fsanitize=address" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
#include <deque>
struct A {

View File

@ -3,10 +3,10 @@
// Zorg configures the ASAN stage2 bots to not build the asan
// compiler-rt. Only run this test on non-asanified configurations.
//
// RUN: %clang -std=gnu11 --driver-mode=gcc -O0 -glldb -fblocks -arch x86_64 \
// RUN: -fsanitize=address %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang-c' --debugger 'lldb' \
// RUN: --cflags "--driver-mode=gcc -O0 -glldb -fblocks -arch x86_64 \
// RUN: -fsanitize=address" --ldflags="-fsanitize=address" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
struct S {
int a[8];

View File

@ -1,8 +1,9 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
//
// RUN: %clang -std=gnu++11 -O0 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -glldb" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
class A {
public:

View File

@ -2,9 +2,9 @@
// UNSUPPORTED: system-windows
//
// This test case checks debug info during register moves for an argument.
// RUN: %clang -std=gnu11 -m64 -mllvm -fast-isel=false -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder clang-c --debugger 'lldb' \
// RUN: --cflags "-m64 -mllvm -fast-isel=false -g" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
//
// Radar 8412415

View File

@ -4,10 +4,9 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %clang -std=gnu++11 -O0 -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-g -O0" -v -- %s
// RUN: --binary %t --debugger 'lldb' -v -- %s
const int d = 100;

View File

@ -1,7 +1,7 @@
// REQUIRES: system-windows
//
// RUN: %dexter --fail-lt 1.0 -w --builder 'clang-cl_vs2015' \
// RUN: --debugger 'dbgeng' --cflags '/Z7 /Zi' --ldflags '/Z7 /Zi' -- %s
// RUN: %clang_cl /Z7 /Zi %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'dbgeng' -- %s
// Check that global constants have debug info.

View File

@ -1,7 +1,7 @@
// REQUIRES: system-windows
//
// RUN: %dexter --fail-lt 1.0 -w --builder 'clang-cl_vs2015' \
// RUN: --debugger 'dbgeng' --cflags '/Z7 /Zi' --ldflags '/Z7 /Zi' -- %s
// RUN: %clang_cl /Z7 /Zi %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'dbgeng' -- %s
#include <stdio.h>
int main() {

View File

@ -1,12 +1,11 @@
// REQUIRES: system-windows
//
// RUN: %dexter --fail-lt 1.0 -w --builder 'clang-cl_vs2015' \
// RUN: --debugger 'dbgeng' --cflags '/Od /Z7 /Zi' \
// RUN: --ldflags '/Od /Z7 /Zi' -- %s
// RUN: %clang_cl /Od /Z7 /Zi %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'dbgeng' -- %s
//
// RUN: %dexter --fail-lt 1.0 -w --builder 'clang-cl_vs2015' \
// RUN: --debugger 'dbgeng' --cflags '/O2 /Z7 /Zi' \
// RUN: --ldflags '/O2 /Z7 /Zi' -- %s
// RUN: %clang_cl /O2 /Z7 /Zi %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --binary %t \
// RUN: --debugger 'dbgeng' -- %s
// This code is structured to have an early exit with an epilogue in the middle
// of the function, which creates a gap between the beginning of the inlined

View File

@ -3,8 +3,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder 'clang-c' --cflags "-O3 -glldb" -- %s
// RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
//// Adapted from https://bugs.llvm.org/show_bug.cgi?id=34136#c1
//// LowerDbgDeclare has since been updated to look through bitcasts. We still

View File

@ -3,8 +3,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder 'clang-c' --cflags "-O3 -glldb" -- %s
// RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
//// Adapted from https://bugs.llvm.org/show_bug.cgi?id=34136#c4

View File

@ -1,7 +1,7 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder clang-c --cflags "-O2 -glldb" -- %s
// RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
//// Check that we give good locations to a variable ('local') which is escaped
//// down some control paths and not others. This example is handled well currently.

View File

@ -3,8 +3,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder 'clang-c' --cflags "-O3 -glldb" -- %s
// RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
//// Check that 'param' in 'fun' can be read throughout, and that 'pa' and 'pb'
//// can be dereferenced in the debugger even if we can't provide the pointer

View File

@ -3,8 +3,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder 'clang-c' --cflags "-O3 -glldb" -- %s
// RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
// 1. param is escaped by inlineme(&param) so it is not promoted by
// SROA/mem2reg.

View File

@ -3,8 +3,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder clang-c --cflags "-O2 -glldb" -- %s
// RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
//
//// Check that once-escaped variable 'param' can still be read after we
//// perform inlining + mem2reg, and that we see the DSE'd value 255.

View File

@ -1,7 +1,7 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder clang-c --cflags "-O2 -glldb" -- %s
// RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
//
//// Check that the once-escaped variable 'param' can still be read after
//// we perform inlining + mem2reg. See D89810 and D85555.

View File

@ -3,8 +3,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder 'clang-c' --cflags "-O3 -glldb" -- %s
// RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
//// Check that escaped local 'param' in function 'fun' has sensible debug info
//// after the escaping function 'use' gets arg promotion (int* -> int). Currently

View File

@ -3,8 +3,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder 'clang-c' --cflags "-O3 -glldb" -- %s
// RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
// 1. parama is escaped by esc(&parama) so it is not promoted by
// SROA/mem2reg.

View File

@ -4,8 +4,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder clang-c --cflags "-O2 -glldb" -- %s
// RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
//
//// Check that a pointer to a variable living on the stack dereferences to the
//// variable value.

View File

@ -4,8 +4,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder clang-c --cflags "-O2 -glldb" -- %s
// RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
//
//// Check debug-info for the escaped struct variable num is reasonable.

View File

@ -5,8 +5,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 0.1 -w --debugger lldb \
// RUN: --builder 'clang-c' --cflags "-O3 -glldb" -- %s
// RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
// RUN: %dexter --fail-lt 0.1 -w --debugger lldb --binary %t -- %s
// See NOTE at end for more info about the RUN command.
// 1. SROA/mem2reg fully promotes parama.

View File

@ -5,9 +5,9 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %clang -g -O0 %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-g -O0" -v -- %s
// RUN: --binary %t --debugger 'lldb' -v -- %s
#include <stdio.h>

View File

@ -7,13 +7,13 @@
// Zorg configures the ASAN stage2 bots to not build the asan
// compiler-rt. Only run this test on non-asanified configurations.
//
// RUN: %clang -std=gnu++11 -O0 -glldb -fno-exceptions %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-O0 -glldb -fno-exceptions" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
//
// RUN: %clang -std=gnu++11 -O1 -glldb -fno-exceptions %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-O1 -glldb -fno-exceptions" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
//
// PR34513
volatile int sideeffect = 0;

View File

@ -3,8 +3,8 @@
//
// REQUIRES: system-windows
//
// RUN: %dexter --fail-lt 1.0 -w --builder 'clang-cl_vs2015' \
// RUN: --debugger 'dbgeng' --cflags '/Z7 /Zi' --ldflags '/Z7 /Zi' -- %s
// RUN: %clang_cl /Z7 /Zi %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'dbgeng' -- %s
struct string {
string() {}

View File

@ -1,9 +1,9 @@
// RUN: %clang -std=gnu++11 -O2 -ffast-math -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-ffast-math -O2 -g" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
// RUN: %clang -std=gnu++11 -O0 -ffast-math -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-ffast-math -O0 -g" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
// REQUIRES: lldb
// UNSUPPORTED: system-windows

View File

@ -5,9 +5,9 @@
// UNSUPPORTED: system-windows
// UNSUPPORTED: system-darwin
// RUN: %clang -std=gnu++11 -O2 -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-O2 -g" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
// A simple loop of assignments.
// With optimization level > 0 the compiler reorders basic blocks

View File

@ -1,9 +1,9 @@
// RUN: %clang++ -std=gnu++11 -O2 -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-O2 -g" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
// RUN: %clang++ -std=gnu++11 -O0 -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-O0 -g" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
// REQUIRES: lldb, D136396
// UNSUPPORTED: system-windows

View File

@ -1,9 +1,9 @@
// RUN: %clang++ -std=gnu++11 -O2 -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-g -O2" -v -- %s
// RUN: --binary %t --debugger 'lldb' -v -- %s
// RUN: %clang++ -std=gnu++11 -O0 -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-g -O0" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
// REQUIRES: lldb
// UNSUPPORTED: system-windows

View File

@ -1,9 +1,9 @@
// RUN: %clang++ -std=gnu++11 -O2 -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-g -O2" -v -- %s
// RUN: --binary %t --debugger 'lldb' -v -- %s
// RUN: %clang++ -std=gnu++11 -O0 -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder 'clang' --debugger 'lldb' \
// RUN: --cflags "-g -O0" -- %s
// RUN: --binary %t --debugger 'lldb' -- %s
// REQUIRES: lldb
// UNSUPPORTED: system-windows
@ -77,12 +77,11 @@ T test2(T x, T y) {
// DexExpectWatchValue('tmp[1]', 8, on_line=ref('break_2'))
// DexExpectWatchValue('tmp[2]', 10, on_line=ref('break_2'))
// DexExpectWatchValue('tmp[3]', 12, on_line=ref('break_2'))
// DexLimitSteps('i', 3, on_line=ref('break_3'))
// DexLimitSteps('i', 3, from_line=ref('break_3'), to_line=ref('break_5'))
// DexExpectWatchValue('tmp[0]', 63, on_line=ref('break_3'))
// DexExpectWatchValue('tmp[1]', 94, on_line=ref('break_3'))
// DexExpectWatchValue('tmp[2]', 95, on_line=ref('break_3'))
// DexExpectWatchValue('tmp[3]', 120, on_line=ref('break_3'))
// DexLimitSteps('i', 3, on_line=ref('break_5'))
// DexExpectWatchValue('tmp[0]', 15, on_line=ref('break_5'))
template<typename T>

View File

@ -1,7 +1,7 @@
// REQUIRES: system-windows
//
// RUN: %dexter --fail-lt 1.0 -w --builder 'clang-cl_vs2015' \
// RUN: --debugger 'dbgeng' --cflags '/Z7 /Zi' --ldflags '/Z7 /Zi' -- %s
// RUN: %clang_cl /Z7 /Zi %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'dbgeng' -- %s
// From https://llvm.org/pr38857, where we had issues with stack realignment.

View File

@ -1,8 +1,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
//
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder clang-c --debugger 'lldb' --cflags "-O -glldb" -- %s
// RUN: %clang -std=gnu11 -O -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'lldb' -- %s
void __attribute__((noinline, optnone)) bar(int *test) {}
int main() {

View File

@ -2,8 +2,8 @@
// REQUIRES: lldb
// UNSUPPORTED: system-windows
//
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --builder clang-c --debugger 'lldb' --cflags "-O0 -glldb" -- %s
// RUN: %clang -std=gnu11 -O0 -glldb %s -o %t
// RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'lldb' -- %s
void init_vla(int size) {
int i;

View File

@ -33,13 +33,15 @@ DExTer is current compatible with 'clang' and 'clang-cl' compiler drivers. The
## Running a test case
The following DExTer commands build the test.cpp from the tests/nostdlib/fibonacci directory and quietly runs it on the Visual Studio debugger, reporting the debug experience heuristic. The first command builds with no optimizations (/Od) and scores 1.0000. The second command builds with optimizations (/Ox) and scores 0.2832 which suggests a worse debugging experience.
The following commands build fibonacci.cpp from the tests/nostdlib directory and run it in LLDB, reporting the debug experience heuristic. The first pair of commands build with no optimizations (-O0) and score 1.0000. The second pair of commands build with optimizations (-O2) and score 0.2832 which suggests a worse debugging experience.
dexter.py test --builder clang-cl_vs2015 --debugger vs2017 --cflags="/Od /Zi" --ldflags="/Zi" -- tests/nostdlib/fibonacci
fibonacci = (1.0000)
clang -O0 -g tests/nostdlib/fibonacci.cpp -o tests/nostdlib/fibonacci/test
dexter.py test --binary tests/nostdlib/fibonacci/test --debugger lldb -- tests/nostdlib/fibonacci/test.cpp
test.cpp = (1.0000)
dexter.py test --builder clang-cl_vs2015 --debugger vs2017 --cflags="/Ox /Zi" --ldflags="/Zi" -- tests/nostdlib/fibonacci
fibonacci = (0.2832)
clang -O2 -g tests/nostdlib/fibonacci/test.cpp -o tests/nostdlib/fibonacci/test
dexter.py test --binary tests/nostdlib/fibonacci/test --debugger lldb -- tests/nostdlib/fibonacci/test.cpp
test.cpp = (0.2832)
## An example test case
@ -107,9 +109,9 @@ to step into a file outside of the test directory.
## Detailed DExTer reports
Running the command below launches the tests/nostdlib/fibonacci test case in DExTer, using clang-cl as the compiler, Visual Studio 2017 as the debugger, and producing a detailed report:
Running the command below launches the tests/nostdlib/fibonacci test case in DExTer, using LLDB as the debugger and producing a detailed report:
$ dexter.py test --builder clang-cl_vs2015 --debugger vs2017 --cflags="/Ox /Zi" --ldflags="/Zi" -v -- tests/nostdlib/fibonacci
$ dexter.py test --vs-solution clang-cl_vs2015 --debugger vs2017 --cflags="/Ox /Zi" --ldflags="/Zi" -v -- tests/nostdlib/fibonacci
The detailed report is enabled by `-v` and shows a breakdown of the information from each debugger step. For example:
@ -255,50 +257,4 @@ shows that for `first` the expected values 0, 1, 2 and 3 were seen, 5 was not.
## Writing new test cases
Each test requires a `test.cfg` file. Currently the contents of this file are not read, but its presence is used to determine the root directory of a test. In the future, configuration variables for the test such as supported language modes may be stored in this file. Use the various [commands](Commands.md) to encode debugging expectations.
## Additional tools
For clang-based compilers, the `clang-opt-bisect` tool can be used to get a breakdown of which LLVM passes may be contributing to debugging experience issues. For example:
$ dexter.py clang-opt-bisect tests/nostdlib/fibonacci --builder clang-cl --debugger vs2017 --cflags="/Ox /Zi" --ldflags="/Zi"
pass 1/211 = (1.0000) (0.0000) [Simplify the CFG on function (?Fibonacci@@YAXHAEAH@Z)]
pass 2/211 = (0.7611) (-0.2389) [SROA on function (?Fibonacci@@YAXHAEAH@Z)]
pass 3/211 = (0.7611) (0.0000) [Early CSE on function (?Fibonacci@@YAXHAEAH@Z)]
pass 4/211 = (0.7611) (0.0000) [Simplify the CFG on function (main)]
pass 5/211 = (0.7611) (0.0000) [SROA on function (main)]
pass 6/211 = (0.7611) (0.0000) [Early CSE on function (main)]
pass 7/211 = (0.7611) (0.0000) [Infer set function attributes on module (c:\dexter\tests\fibonacci\test.cpp)]
pass 8/211 = (0.7611) (0.0000) [Interprocedural Sparse Conditional Constant Propagation on module (c:\dexter\tests\fibonacci\test.cpp)]
pass 9/211 = (0.7611) (0.0000) [Called Value Propagation on module (c:\dexter\tests\fibonacci\test.cpp)]
pass 10/211 = (0.7611) (0.0000) [Global Variable Optimizer on module (c:\dexter\tests\fibonacci\test.cpp)]
pass 11/211 = (0.7611) (0.0000) [Promote Memory to Register on function (?Fibonacci@@YAXHAEAH@Z)]
pass 12/211 = (0.7611) (0.0000) [Promote Memory to Register on function (main)]
pass 13/211 = (0.7611) (0.0000) [Dead Argument Elimination on module (c:\dexter\tests\fibonacci\test.cpp)]
pass 14/211 = (0.7611) (0.0000) [Combine redundant instructions on function (?Fibonacci@@YAXHAEAH@Z)]
pass 15/211 = (0.7611) (0.0000) [Simplify the CFG on function (?Fibonacci@@YAXHAEAH@Z)]a
pass 16/211 = (0.7345) (-0.0265) [Combine redundant instructions on function (main)]
pass 17/211 = (0.7345) (0.0000) [Simplify the CFG on function (main)]
pass 18/211 = (0.7345) (0.0000) [Remove unused exception handling info on SCC (?Fibonacci@@YAXHAEAH@Z)]
pass 19/211 = (0.7345) (0.0000) [Function Integration/Inlining on SCC (?Fibonacci@@YAXHAEAH@Z)]
pass 20/211 = (0.7345) (0.0000) [Deduce function attributes on SCC (?Fibonacci@@YAXHAEAH@Z)]
pass 21/211 = (0.7345) (0.0000) [SROA on function (?Fibonacci@@YAXHAEAH@Z)]
pass 22/211 = (0.7345) (0.0000) [Early CSE w/ MemorySSA on function (?Fibonacci@@YAXHAEAH@Z)]
pass 23/211 = (0.7345) (0.0000) [Speculatively execute instructions if target has divergent branches on function (?Fibonacci@@YAXHAEAH@Z)]
pass 24/211 = (0.7345) (0.0000) [Jump Threading on function (?Fibonacci@@YAXHAEAH@Z)]
pass 25/211 = (0.7345) (0.0000) [Value Propagation on function (?Fibonacci@@YAXHAEAH@Z)]
pass 26/211 = (0.7345) (0.0000) [Simplify the CFG on function (?Fibonacci@@YAXHAEAH@Z)]
pass 27/211 = (0.7345) (0.0000) [Combine redundant instructions on function (?Fibonacci@@YAXHAEAH@Z)]
pass 28/211 = (0.7345) (0.0000) [Tail Call Elimination on function (?Fibonacci@@YAXHAEAH@Z)]
pass 29/211 = (0.7345) (0.0000) [Simplify the CFG on function (?Fibonacci@@YAXHAEAH@Z)]
pass 30/211 = (0.7345) (0.0000) [Reassociate expressions on function (?Fibonacci@@YAXHAEAH@Z)]
pass 31/211 = (0.8673) (0.1327) [Rotate Loops on loop]
pass 32/211 = (0.5575) (-0.3097) [Loop Invariant Code Motion on loop]
pass 33/211 = (0.5575) (0.0000) [Unswitch loops on loop]
pass 34/211 = (0.5575) (0.0000) [Simplify the CFG on function (?Fibonacci@@YAXHAEAH@Z)]
pass 35/211 = (0.5575) (0.0000) [Combine redundant instructions on function (?Fibonacci@@YAXHAEAH@Z)]
pass 36/211 = (0.5575) (0.0000) [Induction Variable Simplification on loop]
pass 37/211 = (0.5575) (0.0000) [Recognize loop idioms on loop]
<output-snipped>
Each test can be either embedded within the source file using comments or included as a separate file with the .dex extension. Dexter does not include support for building test cases, although if a Visual Studio Solution (.sln) is used as the test file, VS will build the program as part of launching a debugger session if it has not already been built.

View File

@ -1,127 +0,0 @@
# DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Deals with the processing execution of shell or batch build scripts."""
import os
import subprocess
import unittest
from dex.dextIR import BuilderIR
from dex.utils import Timer
from dex.utils.Exceptions import BuildScriptException
def _quotify(text):
if '"' in text or " " not in text:
return text
return '"{}"'.format(text)
def _get_script_environment(
source_files, compiler_options, linker_options, executable_file
):
source_files = [_quotify(f) for f in source_files]
object_files = [_quotify("{}.o".format(os.path.basename(f))) for f in source_files]
source_indexes = ["{:02d}".format(i + 1) for i in range(len(source_files))]
env_variables = {}
env_variables["SOURCE_INDEXES"] = " ".join(source_indexes)
env_variables["SOURCE_FILES"] = " ".join(source_files)
env_variables["OBJECT_FILES"] = " ".join(object_files)
env_variables["LINKER_OPTIONS"] = linker_options
for i, _ in enumerate(source_files):
index = source_indexes[i]
env_variables["SOURCE_FILE_{}".format(index)] = source_files[i]
env_variables["OBJECT_FILE_{}".format(index)] = object_files[i]
env_variables["COMPILER_OPTIONS_{}".format(index)] = compiler_options[i]
env_variables["EXECUTABLE_FILE"] = executable_file
return env_variables
def run_external_build_script(
context,
script_path,
source_files,
compiler_options,
linker_options,
executable_file,
):
"""Build an executable using a builder script.
The executable is saved to `context.working_directory.path`.
Returns:
( stdout (str), stderr (str), builder (BuilderIR) )
"""
builderIR = BuilderIR(
name=context.options.builder,
cflags=compiler_options,
ldflags=linker_options,
)
assert len(source_files) == len(compiler_options), (source_files, compiler_options)
script_environ = _get_script_environment(
source_files, compiler_options, linker_options, executable_file
)
env = dict(os.environ)
env.update(script_environ)
try:
with Timer("running build script"):
process = subprocess.Popen(
[script_path],
cwd=context.working_directory.path,
env=env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
out, err = process.communicate()
returncode = process.returncode
out = out.decode("utf-8")
err = err.decode("utf-8")
if returncode != 0:
raise BuildScriptException(
"{}: failed with returncode {}.\nstdout:\n{}\n\nstderr:\n{}\n".format(
script_path, returncode, out, err
),
script_error=err,
)
return out, err, builderIR
except OSError as e:
raise BuildScriptException("{}: {}".format(e.strerror, script_path))
class TestBuilder(unittest.TestCase):
def test_get_script_environment(self):
source_files = ["a.a", "b.b"]
compiler_options = ["-option1 value1", "-option2 value2"]
linker_options = "-optionX valueX"
executable_file = "exe.exe"
env = _get_script_environment(
source_files, compiler_options, linker_options, executable_file
)
assert env["SOURCE_FILES"] == "a.a b.b"
assert env["OBJECT_FILES"] == "a.a.o b.b.o"
assert env["SOURCE_INDEXES"] == "01 02"
assert env["LINKER_OPTIONS"] == "-optionX valueX"
assert env["SOURCE_FILE_01"] == "a.a"
assert env["SOURCE_FILE_02"] == "b.b"
assert env["OBJECT_FILE_01"] == "a.a.o"
assert env["OBJECT_FILE_02"] == "b.b.o"
assert env["EXECUTABLE_FILE"] == "exe.exe"
assert env["COMPILER_OPTIONS_01"] == "-option1 value1"
assert env["COMPILER_OPTIONS_02"] == "-option2 value2"

View File

@ -1,63 +0,0 @@
# DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Command line options for subtools that use the builder component."""
import os
from dex.tools import Context
from dex.utils import is_native_windows
def _find_build_scripts():
"""Finds build scripts in the 'scripts' subdirectory.
Returns:
{ script_name (str): directory (str) }
"""
try:
return _find_build_scripts.cached
except AttributeError:
scripts_directory = os.path.join(os.path.dirname(__file__), "scripts")
if is_native_windows():
scripts_directory = os.path.join(scripts_directory, "windows")
else:
scripts_directory = os.path.join(scripts_directory, "posix")
assert os.path.isdir(scripts_directory), scripts_directory
results = {}
for f in os.listdir(scripts_directory):
results[os.path.splitext(f)[0]] = os.path.abspath(
os.path.join(scripts_directory, f)
)
_find_build_scripts.cached = results
return results
def add_builder_tool_arguments(parser):
build_group = parser.add_mutually_exclusive_group(required=True)
build_group.add_argument(
"--binary", metavar="<file>", help="provide binary file instead of --builder"
)
build_group.add_argument(
"--builder",
type=str,
choices=sorted(_find_build_scripts().keys()),
help="test builder to use",
)
build_group.add_argument(
"--vs-solution",
metavar="<file>",
help="provide a path to an already existing visual studio solution.",
)
parser.add_argument("--cflags", type=str, default="", help="compiler flags")
parser.add_argument("--ldflags", type=str, default="", help="linker flags")
def handle_builder_tool_options(context: Context) -> str:
return _find_build_scripts()[context.options.builder]

View File

@ -1,10 +0,0 @@
# DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from dex.builder.Builder import run_external_build_script
from dex.builder.ParserOptions import add_builder_tool_arguments
from dex.builder.ParserOptions import handle_builder_tool_options

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -e
if test -z "$PATHTOCLANG"; then
PATHTOCLANG=clang
fi
for INDEX in $SOURCE_INDEXES
do
CFLAGS=$(eval echo "\$COMPILER_OPTIONS_$INDEX")
SRCFILE=$(eval echo "\$SOURCE_FILE_$INDEX")
OBJFILE=$(eval echo "\$OBJECT_FILE_$INDEX")
$PATHTOCLANG -std=gnu11 -c $CFLAGS $SRCFILE -o $OBJFILE
done
$PATHTOCLANG $LINKER_OPTIONS $OBJECT_FILES -o $EXECUTABLE_FILE

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -e
if test -z "$PATHTOCLANGPP"; then
PATHTOCLANGPP=clang++
fi
for INDEX in $SOURCE_INDEXES
do
CFLAGS=$(eval echo "\$COMPILER_OPTIONS_$INDEX")
SRCFILE=$(eval echo "\$SOURCE_FILE_$INDEX")
OBJFILE=$(eval echo "\$OBJECT_FILE_$INDEX")
$PATHTOCLANGPP -std=gnu++11 -c $CFLAGS $SRCFILE -o $OBJFILE
done
$PATHTOCLANGPP $LINKER_OPTIONS $OBJECT_FILES -o $EXECUTABLE_FILE

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -e
if test -z "$PATHTOGCC"; then
PATHTOGCC=gcc
fi
for INDEX in $SOURCE_INDEXES
do
CFLAGS=$(eval echo "\$COMPILER_OPTIONS_$INDEX")
SRCFILE=$(eval echo "\$SOURCE_FILE_$INDEX")
OBJFILE=$(eval echo "\$OBJECT_FILE_$INDEX")
$PATHTOGCC -std=gnu++11 -c $CFLAGS $SRCFILE -o $OBJFILE
done
$PATHTOGCC $LINKER_OPTIONS $OBJECT_FILES -o $EXECUTABLE_FILE

View File

@ -1,23 +0,0 @@
@echo OFF
setlocal EnableDelayedExpansion
call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
@echo OFF
setlocal EnableDelayedExpansion
for %%I in (%SOURCE_INDEXES%) do (
%PATHTOCLANGCL% /c !COMPILER_OPTIONS_%%I! !SOURCE_FILE_%%I! /Fo!OBJECT_FILE_%%I!
if errorlevel 1 goto :FAIL
)
%PATHTOCLANGCL% %LINKER_OPTIONS% %OBJECT_FILES% /Fe%EXECUTABLE_FILE%
if errorlevel 1 goto :FAIL
goto :END
:FAIL
echo FAILED
exit /B 1
:END
exit /B 0

View File

@ -1,17 +0,0 @@
@setlocal EnableDelayedExpansion
for %%I in (%SOURCE_INDEXES%) do (
%PATHTOCLANGPP% -fuse-ld=lld -c !COMPILER_OPTIONS_%%I! !SOURCE_FILE_%%I! -o !OBJECT_FILE_%%I!
if errorlevel 1 goto :FAIL
)
%PATHTOCLANGPP% -fuse-ld=lld %LINKER_OPTIONS% %OBJECT_FILES% -o %EXECUTABLE_FILE%
if errorlevel 1 goto :FAIL
goto :END
:FAIL
echo FAILED
exit /B 1
:END
exit /B 0

View File

@ -15,7 +15,6 @@ from dex.command.CommandBase import CommandBase, StepExpectInfo
class DexDeclareAddress(CommandBase):
def __init__(self, addr_name, expression, **kwargs):
if not isinstance(addr_name, str):
raise TypeError("invalid argument type")

View File

@ -14,7 +14,6 @@ from dex.command.CommandBase import CommandBase
class DexDeclareFile(CommandBase):
def __init__(self, declared_file):
if not isinstance(declared_file, str):
raise TypeError("invalid argument type")

View File

@ -13,7 +13,6 @@ from dex.command.CommandBase import CommandBase
class DexLabel(CommandBase):
def __init__(self, label, **kwargs):
if not isinstance(label, str):
raise TypeError("invalid argument type")

View File

@ -164,7 +164,6 @@ class ConditionalController(DebuggerControllerBase):
total_timeout = Timeout(self.context.options.timeout_total)
while not self.debugger.is_finished:
breakpoint_timeout = Timeout(self.context.options.timeout_breakpoint)
while self.debugger.is_running and not timed_out:
# Check to see whether we've timed out while we're waiting.

View File

@ -96,7 +96,6 @@ class DefaultController(DebuggerControllerBase):
total_timeout = Timeout(self.context.options.timeout_total)
max_steps = self.context.options.max_steps
for _ in range(max_steps):
breakpoint_timeout = Timeout(self.context.options.timeout_breakpoint)
while self.debugger.is_running and not timed_out:
# Check to see whether we've timed out while we're waiting.

View File

@ -40,7 +40,6 @@ VSBreakpoint = namedtuple("VSBreakpoint", "path, line, col, cond")
class VisualStudio(
DebuggerBase, metaclass=abc.ABCMeta
): # pylint: disable=abstract-method
# Constants for results of Debugger.CurrentMode
# (https://msdn.microsoft.com/en-us/library/envdte.debugger.currentmode.aspx)
dbgDesignMode = 1

View File

@ -8,7 +8,6 @@ from collections import OrderedDict
import os
from typing import List
from dex.dextIR.BuilderIR import BuilderIR
from dex.dextIR.DebuggerIR import DebuggerIR
from dex.dextIR.StepIR import StepIR, StepKind
@ -47,14 +46,12 @@ class DextIR:
dexter_version: str,
executable_path: str,
source_paths: List[str],
builder: BuilderIR = None,
debugger: DebuggerIR = None,
commands: OrderedDict = None,
):
self.dexter_version = dexter_version
self.executable_path = executable_path
self.source_paths = source_paths
self.builder = builder
self.debugger = debugger
self.commands = commands
self.steps: List[StepIR] = []

View File

@ -7,7 +7,6 @@
"""dextIR: DExTer Intermediate Representation of DExTer's debugger trace output.
"""
from dex.dextIR.BuilderIR import BuilderIR
from dex.dextIR.DextIR import DextIR
from dex.dextIR.DebuggerIR import DebuggerIR
from dex.dextIR.FrameIR import FrameIR

View File

@ -66,7 +66,6 @@ def get_tools_directory():
def get_tool_names():
"""Returns a list of expected DExTer Tools"""
return [
"clang-opt-bisect",
"help",
"list-debuggers",
"no-tool-",
@ -193,7 +192,6 @@ class Context(object):
def main() -> ReturnCode:
context = Context()
with PrettyOutput() as context.o:

View File

@ -4,15 +4,13 @@
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Base class for subtools that do build/run tests."""
"""Base class for subtools that run tests."""
import abc
from datetime import datetime
import os
import sys
from dex.builder import add_builder_tool_arguments
from dex.builder import handle_builder_tool_options
from dex.debugger.Debuggers import add_debugger_tool_arguments
from dex.debugger.Debuggers import handle_debugger_tool_options
from dex.heuristic.Heuristic import add_heuristic_tool_arguments
@ -22,15 +20,26 @@ from dex.utils.Exceptions import Error, ToolArgumentError
from dex.utils.ReturnCode import ReturnCode
def add_executable_arguments(parser):
executable_group = parser.add_mutually_exclusive_group(required=True)
executable_group.add_argument(
"--binary", metavar="<file>", help="provide binary file to debug"
)
executable_group.add_argument(
"--vs-solution",
metavar="<file>",
help="provide a path to an already existing visual studio solution.",
)
class TestToolBase(ToolBase):
def __init__(self, *args, **kwargs):
super(TestToolBase, self).__init__(*args, **kwargs)
self.build_script: str = None
def add_tool_arguments(self, parser, defaults):
parser.description = self.__doc__
add_builder_tool_arguments(parser)
add_debugger_tool_arguments(parser, self.context, defaults)
add_executable_arguments(parser)
add_heuristic_tool_arguments(parser)
parser.add_argument(
@ -53,12 +62,6 @@ class TestToolBase(ToolBase):
def handle_options(self, defaults):
options = self.context.options
if not options.builder and (options.cflags or options.ldflags):
self.context.logger.warning(
"--cflags and --ldflags will be ignored when not using --builder",
enable_prefix=True,
)
if options.vs_solution:
options.vs_solution = os.path.abspath(options.vs_solution)
if not os.path.isfile(options.vs_solution):
@ -73,11 +76,6 @@ class TestToolBase(ToolBase):
raise Error(
'<d>could not find binary file</> <r>"{}"</>'.format(options.binary)
)
else:
try:
self.build_script = handle_builder_tool_options(self.context)
except ToolArgumentError as e:
raise Error(e)
try:
handle_debugger_tool_options(self.context, defaults)
@ -113,37 +111,14 @@ class TestToolBase(ToolBase):
)
# Test files contain dexter commands.
options.test_files = []
# Source files are to be compiled by the builder script and may also
# contains dexter commands.
options.test_files = [options.test_path]
# Source files are the files that the program was built from, and are
# used to determine whether a breakpoint is external to the program
# (e.g. into a system header) or not.
options.source_files = []
if os.path.isdir(options.test_path):
subdirs = sorted(
[r for r, _, f in os.walk(options.test_path) if "test.cfg" in f]
)
for subdir in subdirs:
for f in os.listdir(subdir):
# TODO: read file extensions from the test.cfg file instead so
# that this isn't just limited to C and C++.
file_path = os.path.normcase(os.path.join(subdir, f))
if f.endswith(".cpp"):
options.source_files.append(file_path)
elif f.endswith(".c"):
options.source_files.append(file_path)
elif f.endswith(".dex"):
options.test_files.append(file_path)
# Source files can contain dexter commands too.
options.test_files = options.test_files + options.source_files
self._run_test(self._get_test_name(subdir))
else:
# We're dealing with a direct file path to a test file. If the file is non
# .dex, then it must be a source file.
if not options.test_path.endswith(".dex"):
options.source_files = [options.test_path]
options.test_files = [options.test_path]
self._run_test(self._get_test_name(options.test_path))
if not options.test_path.endswith(".dex"):
options.source_files = [options.test_path]
self._run_test(self._get_test_name(options.test_path))
return self._handle_results()

View File

@ -1,8 +0,0 @@
# DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from dex.tools.clang_opt_bisect.Tool import Tool

View File

@ -12,7 +12,6 @@ import csv
import pickle
import shutil
from dex.builder import run_external_build_script
from dex.command.ParseCommand import get_command_infos
from dex.debugger.Debuggers import run_debugger_subprocess
from dex.debugger.DebuggerControllers.DefaultController import DefaultController
@ -24,7 +23,6 @@ from dex.utils.Exceptions import DebuggerException
from dex.utils.Exceptions import BuildScriptException, HeuristicException
from dex.utils.PrettyOutputBase import Stream
from dex.utils.ReturnCode import ReturnCode
from dex.dextIR import BuilderIR
class TestCase(object):
@ -109,36 +107,6 @@ class Tool(TestToolBase):
)
super(Tool, self).add_tool_arguments(parser, defaults)
def _build_test_case(self):
"""Build an executable from the test source with the given --builder
script and flags (--cflags, --ldflags) in the working directory.
Or, if the --binary option has been given, copy the executable provided
into the working directory and rename it to match the --builder output
or skip if --vs-solution was passed on the command line.
"""
if self.context.options.vs_solution:
return
options = self.context.options
if options.binary:
# Copy user's binary into the tmp working directory
shutil.copy(options.binary, options.executable)
builderIR = BuilderIR(name="binary", cflags=[options.binary], ldflags="")
else:
options = self.context.options
compiler_options = [options.cflags for _ in options.source_files]
linker_options = options.ldflags
_, _, builderIR = run_external_build_script(
self.context,
script_path=self.build_script,
source_files=options.source_files,
compiler_options=compiler_options,
linker_options=linker_options,
executable_file=options.executable,
)
return builderIR
def _init_debugger_controller(self):
step_collection = DextIR(
executable_path=self.context.options.executable,
@ -159,14 +127,13 @@ class Tool(TestToolBase):
return debugger_controller
def _get_steps(self, builderIR):
def _get_steps(self):
"""Generate a list of debugger steps from a test case."""
debugger_controller = self._init_debugger_controller()
debugger_controller = run_debugger_subprocess(
debugger_controller, self.context.working_directory.path
)
steps = debugger_controller.step_collection
steps.builder = builderIR
return steps
def _get_results_basename(self, test_name):
@ -249,8 +216,12 @@ class Tool(TestToolBase):
result internally in self._test_cases.
"""
try:
builderIR = self._build_test_case()
steps = self._get_steps(builderIR)
if self.context.options.binary:
# Copy user's binary into the tmp working directory.
shutil.copy(
self.context.options.binary, self.context.options.executable
)
steps = self._get_steps()
self._record_steps(test_name, steps)
heuristic_score = Heuristic(self.context, steps)
self._record_score(test_name, heuristic_score)

View File

@ -27,7 +27,6 @@ class _CONSOLE_SCREEN_BUFFER_INFO(ctypes.Structure):
class PrettyOutput(PrettyOutputBase):
stdout = Stream(sys.stdout, ctypes.windll.kernel32.GetStdHandle(-11))
stderr = Stream(sys.stderr, ctypes.windll.kernel32.GetStdHandle(-12))

View File

@ -5,7 +5,8 @@
// UNSUPPORTED: system-darwin
//
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: dex_declare_file.cpp
int main() {

View File

@ -4,7 +4,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_program_state.cpp:
int GCD(int lhs, int rhs)

View File

@ -4,7 +4,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_step_kinds.cpp:
int abs(int i){

View File

@ -4,7 +4,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_step_order.cpp:
int main()

View File

@ -9,7 +9,8 @@
// TODO: Reduce this test's coverage and be more specific about
// expected behaviour.
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_watch_type.cpp:
template<class T>

View File

@ -5,7 +5,8 @@
// UNSUPPORTED: system-darwin
//
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_watch_value.cpp:
int main()

View File

@ -4,7 +4,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: float_range_out_range.cpp:
int main() {

View File

@ -4,7 +4,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: float_range_zero_nonmatch.cpp:
int main() {

View File

@ -5,7 +5,8 @@
// The dbgeng driver doesn't support \DexDeclareAddress yet.
// UNSUPPORTED: system-windows
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: missing_dex_address.cpp
int main() {

View File

@ -5,7 +5,8 @@
// UNSUPPORTED: system-darwin
//
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: unreachable.cpp:
int

View File

@ -5,7 +5,8 @@
// UNSUPPORTED: system-darwin
//
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: unreachable_line_range.cpp:
int

View File

@ -5,7 +5,8 @@
// UNSUPPORTED: system-darwin
//
//
// RUN: not %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: unreachable_on_line.cpp:
int

View File

@ -1,7 +1,8 @@
// The dbgeng driver doesn't support \DexCommandLine yet.
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: command_line.c:
int main(int argc, const char **argv) {

View File

@ -2,7 +2,8 @@
// Test that a \DexDeclareAddress value can have its value defined after
// the first reference to that value.
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: address_after_ref.cpp
int main() {

View File

@ -4,7 +4,8 @@
// expression after the target line has been stepped on a given number of
// times.
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: address_hit_count.cpp
int main() {

View File

@ -2,7 +2,8 @@
// Test that a \DexDeclareAddress value can be used to compare the
// addresses of two local variables that refer to the same address.
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expression_address.cpp
int main() {

View File

@ -2,7 +2,8 @@
// Test that a \DexDeclareAddress value can be used to compare two equal
// pointer variables.
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: identical_address.cpp
int main() {

View File

@ -2,7 +2,8 @@
// Test that multiple \DexDeclareAddress references that point to different
// addresses can be used within a single \DexExpectWatchValue.
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: multiple_address.cpp
int main() {

View File

@ -2,7 +2,8 @@
// Test that a \DexDeclareAddress value can be used to compare two pointer
// variables that have a fixed offset between them.
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: offset_address.cpp
int main() {

View File

@ -2,7 +2,8 @@
// Test that a \DexDeclareAddress value can be used to check the change in
// value of a variable over time, relative to its initial value.
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: self_comparison.cpp
int main() {

View File

@ -6,7 +6,8 @@
// UNSUPPORTED: system-darwin
//
//
// RUN: %dexter_regression_test -- %S | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: dex_and_source
int main() {

View File

@ -4,7 +4,7 @@
#
# UNSUPPORTED: system-darwin
#
# RUN: %clang %S/test.cpp -O0 -g -o %t
# RUN: %dexter_regression_test_build %S/test.cpp -o %t
# RUN: %dexter_regression_base --binary %t %s | FileCheck %s
# CHECK: commands.dex
#

View File

@ -3,7 +3,7 @@
#
# REQUIRES: system-windows
#
# RUN: %clang "%S/source/test file.cpp" -O0 -g -o %t
# RUN: %dexter_regression_test_build "%S/source/test file.cpp" -o %t
# RUN: %dexter_regression_base --binary %t %s | FileCheck %s
# CHECK: test.dex
#

View File

@ -6,7 +6,8 @@
// condition (x == 5) is satisfied.
// Tests using the default controller (no \DexLimitSteps).
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: default_conditional.cpp
int main() {

View File

@ -7,7 +7,8 @@
// given number of times.
// Tests using the default controller (no \DexLimitSteps).
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: default_conditional_hit_count.cpp
int main() {

View File

@ -4,7 +4,8 @@
// specific number of times.
// Tests using the default controller (no \DexLimitSteps).
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: default_hit_count.cpp
int main() {

View File

@ -4,7 +4,8 @@
// is stepped on.
// Tests using the default controller (no \DexLimitSteps).
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: default_simple.cpp
int main() {

View File

@ -7,7 +7,8 @@
// The dbgeng driver doesn't support \DexLimitSteps yet.
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: limit_steps_conditional.cpp
int main() {

View File

@ -8,7 +8,8 @@
// The dbgeng driver doesn't support \DexLimitSteps yet.
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: limit_steps_conditional_hit_count.cpp
int main() {

View File

@ -7,7 +7,8 @@
// The dbgeng driver doesn't support \DexLimitSteps yet.
// UNSUPPORTED: system-windows
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: limit_steps_hit_count.cpp
int main() {

View File

@ -7,7 +7,8 @@
// The dbgeng driver doesn't support \DexLimitSteps yet.
// UNSUPPORTED: system-windows, system-darwin
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: limit_steps_simple.cpp
int main() {

View File

@ -5,7 +5,8 @@
// UNSUPPORTED: system-darwin
//
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_program_state.cpp:
int GCD(int lhs, int rhs)

View File

@ -10,7 +10,8 @@
// TODO: The dbgeng debugger does not support column step reporting at present.
// XFAIL: system-windows
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: direction.cpp:
int func(int i) {

View File

@ -5,7 +5,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: func.cpp:
int func(int i) {

View File

@ -8,7 +8,8 @@
// This fails right now on my linux and windows machine, needs examining as to
// why.
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: func_external.cpp:
#include <cstdlib>

View File

@ -5,7 +5,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: recursive.cpp:
int func(int i) {

View File

@ -5,7 +5,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: small_loop.cpp:
int func(int i){

View File

@ -4,10 +4,11 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_step_order.cpp:
int main()
int main() // DexLabel('main')
{
volatile int a = 1; // DexExpectStepOrder(1)
volatile int b = 1; // DexExpectStepOrder(2)
@ -19,6 +20,6 @@ int main()
return 0;
}
// DexExpectStepOrder(4, on_line=16);
// DexExpectStepOrder(5, on_line=17);
// DexExpectStepOrder(6, on_line=18);
// DexExpectStepOrder(4, on_line=ref('main')+6);
// DexExpectStepOrder(5, on_line=ref('main')+7);
// DexExpectStepOrder(6, on_line=ref('main')+8);

View File

@ -8,7 +8,8 @@
// in the same manner as LLDB.
// XFAIL: system-windows
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_watch_type.cpp:
template<class T>

View File

@ -4,7 +4,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: expect_watch_value.cpp:
unsigned long Factorial(int n) {

View File

@ -4,7 +4,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: float_range_multiple.cpp:
int main() {

View File

@ -7,7 +7,8 @@
// work for both dbgeng and lldb, which output floats differently.
// UNSUPPORTED: system-darwin, system-windows
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: float_range_no_arg.cpp:
int main() {

View File

@ -4,7 +4,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: float_range_small.cpp:
int main() {

View File

@ -3,7 +3,8 @@
//
// UNSUPPORTED: system-darwin
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: float_range_zero_match.cpp:
int main() {

View File

@ -2,7 +2,8 @@
// Test that \DexLimitSteps keyword argument hit_count correctly limits
// the number of times the command can trigger.
//
// RUN: %dexter_regression_test -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
// CHECK: hit_count.cpp
int a;

View File

@ -1,7 +1,8 @@
// Purpose:
// Check number of step lines are correctly reported in json output.
//
// RUN: %dexter_regression_test --verbose -- %s | FileCheck %s
// RUN: %dexter_regression_test_build %s -o %t
// RUN: %dexter_regression_test_run --binary %t --verbose -- %s | FileCheck %s
// CHECK: limit_steps_check_json_step_count.cpp
// CHECK: ## BEGIN ##
// CHECK-COUNT-3: json_step_count.cpp",

Some files were not shown because too many files have changed in this diff Show More