diff options
Diffstat (limited to 'debuginfo-tests/dexter/feature_tests/subtools')
10 files changed, 194 insertions, 0 deletions
diff --git a/debuginfo-tests/dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp b/debuginfo-tests/dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp new file mode 100644 index 00000000000..bc625da0e53 --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp @@ -0,0 +1,17 @@ +// Purpose: +// Check the `clang-opt-bisect` tool runs with typical input. +// +// REQUIRES: system-linux, lldb +// +// RUN: true +// RUN: %dexter clang-opt-bisect --debugger 'lldb' --builder 'clang' \ +// RUN: --cflags "-O0 -g" -- %s \ +// RUN: | FileCheck %s +// CHECK: running pass 0 +// CHECK: wrote{{.*}}per_pass_score +// CHECK: wrote{{.*}}pass-summary +// CHECK: wrote{{.*}}overall-pass-summary + +int main() { + return 0; +} diff --git a/debuginfo-tests/dexter/feature_tests/subtools/help/help.test b/debuginfo-tests/dexter/feature_tests/subtools/help/help.test new file mode 100644 index 00000000000..e008147b7cc --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/subtools/help/help.test @@ -0,0 +1,10 @@ +Purpose: + Check the `help` subtool runs. + +RUN: %dexter help | FileCheck %s +CHECK: The following subtools are available: +CHECK: clang-opt-bisect +CHECK: help +CHECK: list-debuggers +CHECK: test +CHECK: view diff --git a/debuginfo-tests/dexter/feature_tests/subtools/list-debuggers/list-debuggers.test b/debuginfo-tests/dexter/feature_tests/subtools/list-debuggers/list-debuggers.test new file mode 100644 index 00000000000..c8f4a890275 --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/subtools/list-debuggers/list-debuggers.test @@ -0,0 +1,7 @@ +Purpose: + Check the `list-debuggers` subtool runs. + +RUN: %dexter list-debuggers | FileCheck %s +CHECK: lldb +CHECK: vs2015 +CHECK: vs2017 diff --git a/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp b/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp new file mode 100644 index 00000000000..25421f397d1 --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp @@ -0,0 +1,22 @@ +// Purpose: +// Check that parsing bad commands gives a useful error. +// - Unbalanced parenthesis +// Check directives are in check.txt to prevent dexter reading any embedded +// commands. +// +// Note: Despite using 'lldb' as the debugger, lldb is not actually required +// as the test should finish before lldb would be invoked. +// +// RUN: not %dexter test --builder 'clang' --debugger 'lldb' \ +// RUN: --cflags "-O0 -g" -v -- %s \ +// RUN: | FileCheck %s --match-full-lines --strict-whitespace +// +// CHECK:parser error:{{.*}}err_paren.cpp(22): Unbalanced parenthesis starting here +// CHECK:// {{Dex}}ExpectWatchValue( +// CHECK: ^ + +int main(){ + return 0; +} + +// DexExpectWatchValue( diff --git a/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp b/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp new file mode 100644 index 00000000000..051ee12fb11 --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp @@ -0,0 +1,25 @@ +// Purpose: +// Check that parsing bad commands gives a useful error. +// - Unbalanced parenthesis over multiple lines +// Check directives are in check.txt to prevent dexter reading any embedded +// commands. +// +// Note: Despite using 'lldb' as the debugger, lldb is not actually required +// as the test should finish before lldb would be invoked. +// +// RUN: not %dexter test --builder 'clang' --debugger "lldb" \ +// RUN: --cflags "-O0 -g" -v -- %s \ +// RUN: | FileCheck %s --match-full-lines --strict-whitespace +// +// CHECK:parser error:{{.*}}err_paren_mline.cpp(23): Unbalanced parenthesis starting here +// CHECK:{{Dex}}ExpectWatchValue( +// CHECK: ^ + +int main(){ + return 0; +} + +/* +DexExpectWatchValue( + 1 +*/ diff --git a/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp b/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp new file mode 100644 index 00000000000..5092eb7e216 --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp @@ -0,0 +1,21 @@ +// Purpose: +// Check that parsing bad commands gives a useful error. +// - Syntax error (misplaced ',') +// Check directives are in check.txt to prevent dexter reading any embedded +// commands. +// +// Note: Despite using 'lldb' as the debugger, lldb is not actually required +// as the test should finish before lldb would be invoked. +// +// RUN: not %dexter test --builder 'clang' --debugger "lldb" \ +// RUN: --cflags "-O0 -g" -v -- %s \ +// RUN: | FileCheck %s --match-full-lines --strict-whitespace +// +// CHECK:parser error:{{.*}}err_syntax.cpp(21): invalid syntax +// CHECK:// {{Dex}}ExpectWatchValue(,'a', 3, 3, 3, 3, on_line=0) +// CHECK: ^ + +int main(){ + return 0; +} +// DexExpectWatchValue(,'a', 3, 3, 3, 3, on_line=0) diff --git a/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp b/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp new file mode 100644 index 00000000000..919528fd847 --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp @@ -0,0 +1,25 @@ +// Purpose: +// Check that parsing bad commands gives a useful error. +// - Syntax error (misplaced ',') over multiple lines +// Check directives are in check.txt to prevent dexter reading any embedded +// commands. +// +// Note: Despite using 'lldb' as the debugger, lldb is not actually required +// as the test should finish before lldb would be invoked. +// +// RUN: not %dexter test --builder 'clang' --debugger "lldb" \ +// RUN: --cflags "-O0 -g" -v -- %s \ +// RUN: | FileCheck %s --match-full-lines --strict-whitespace +// +// CHECK:parser error:{{.*}}err_syntax_mline.cpp(24): invalid syntax +// CHECK: ,'a', 3, 3, 3, 3, on_line=0) +// CHECK: ^ + +int main(){ + return 0; +} + +/* +DexExpectWatchValue( + ,'a', 3, 3, 3, 3, on_line=0) +*/ diff --git a/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp b/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp new file mode 100644 index 00000000000..58a4f33404d --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp @@ -0,0 +1,21 @@ +// Purpose: +// Check that parsing bad commands gives a useful error. +// - Type error (missing args) +// Check directives are in check.txt to prevent dexter reading any embedded +// commands. +// +// Note: Despite using 'lldb' as the debugger, lldb is not actually required +// as the test should finish before lldb would be invoked. +// +// RUN: not %dexter test --builder 'clang' --debugger "lldb" \ +// RUN: --cflags "-O0 -g" -v -- %s \ +// RUN: | FileCheck %s --match-full-lines --strict-whitespace +// +// CHECK:parser error:{{.*}}err_type.cpp(21): expected at least two args +// CHECK:// {{Dex}}ExpectWatchValue() +// CHECK: ^ + +int main(){ + return 0; +} +// DexExpectWatchValue() diff --git a/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp b/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp new file mode 100644 index 00000000000..66e422ed629 --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp @@ -0,0 +1,25 @@ +// Purpose: +// Check that parsing bad commands gives a useful error. +// - Type error (missing args) over multple lines +// Check directives are in check.txt to prevent dexter reading any embedded +// commands. +// +// Note: Despite using 'lldb' as the debugger, lldb is not actually required +// as the test should finish before lldb would be invoked. +// +// RUN: not %dexter test --builder 'clang' --debugger "lldb" \ +// RUN: --cflags "-O0 -g" -v -- %s \ +// RUN: | FileCheck %s --match-full-lines --strict-whitespace +// +// CHECK:parser error:{{.*}}err_type_mline.cpp(22): expected at least two args +// CHECK:{{Dex}}ExpectWatchValue( +// CHECK: ^ + +int main(){ + return 0; +} +/* +DexExpectWatchValue( + 'a' +) +*/ diff --git a/debuginfo-tests/dexter/feature_tests/subtools/view.cpp b/debuginfo-tests/dexter/feature_tests/subtools/view.cpp new file mode 100644 index 00000000000..9c4f2573361 --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/subtools/view.cpp @@ -0,0 +1,21 @@ +// Purpose: +// Check the `view` subtool works with typical inputs. +// +// REQUIRES: system-linux, lldb +// +// RUN: %dexter test --fail-lt 1.0 -w \ +// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" \ +// RUN: --results %t -- %s +// +// RUN: %dexter view %t/view.cpp.dextIR | FileCheck %s +// CHECK: ## BEGIN +// CHECK: ## END +// +// # [TODO] This doesn't run if FileCheck fails! +// RUN: rm -rf %t + +int main() { + int a = 0; + return 0; //DexLabel('ret') +} +// DexExpectWatchValue('a', '0', on_line='ret') |