Commit Graph

107 Commits

Author SHA1 Message Date
Felipe de Azevedo Piovezan
a8837b49c1 [cross-project-tests] Fix struct-dse example so that it fails again (#73566)
The purpose of this example is to provide a case where the debugger /
debug info experience could be improved. A recent commit by clang
(0d2860b795) changed codegen such that it
changes how "small structs" are initialized, in a way that the debugger
is now able to correctly display the variable being targeted by this
test.

In order to keep the example relevant, i.e. failing, this commit makes
it so that the struct is now "big enough" to not trigger the new
codegen.
2023-11-27 13:14:10 -08:00
Ben Mudd
9120e85448 [Dexter] Associate parser errors with correct file (#66765)
Currently if Dexter encounters a parser error with a command, the resulting
error message will refer to the most recently declared file (i.e. the source
file it is testing) rather than the file containing the command itself. This
patch fixes this so that parser errors point towards the correct location.
2023-09-19 14:16:17 +01:00
Shubham Sandeep Rastogi
0d0ab7600f Fix Dexter test broken with e6cc7b723f 2023-09-14 09:34:02 -07:00
Shubham Sandeep Rastogi
e6cc7b723f [Dexter] Fix test failures on greendragon (#66299)
The issue with these test failures is that the dSYM was not being found
by lldb, which is why setting breakpoints was failing and lldb quit
without performing any steps. This change copies the dSYM to the same
temp directory that the executable is copied to.
2023-09-14 09:28:47 -07:00
Douglas Yung
0a6f658f97 Fix Dexter test after 37a20cc68f. Adding the XFAIL line caused the line references to be off.
Should fix https://lab.llvm.org/buildbot/#/builders/216/builds/27001.
2023-09-08 23:34:54 -07:00
Shubham Sandeep Rastogi
37a20cc68f XFAIL dexter tests that broke greendragon.
The patch in https://reviews.llvm.org/D151465 broke greendragon, because
it is hardcoding the use of libstdc++ which is not available on darwin.

XFAILing these tests till they can be fixed.
2023-09-08 15:51:10 -07:00
Christopher Di Bella
4a351ef70a [cross-project-tests] remove final dexter.builder import (#65653) 2023-09-08 11:47:26 +02:00
Stephen Tozer
43d70e4640 [DebugInfoTests] Mark debuginfo 'optnone-*' tests unsupported on darwin
The optnone tests, following the removal of the Dexter builder in a
prior patch (45a40c16), are experiencing intermittent failures. This
patch marks them unsupported to be fixed in a new commit, rather than
reverting the Dexter patch.
2023-09-06 16:12:04 +01:00
Stephen Tozer
45a40c1639 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 5647f2908d.
2023-09-06 15:06:07 +01:00
Stephen Tozer
5647f2908d Revert "Reapply "[Dexter] Remove builder from Dexter""
Re-application of the Dexter builder removal reversed due to continued
errors on the green dragon LLDB buildbot:
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/59716/

Cause of the error is unclear, but it looks as though there is some
unexpected non-determinism in the test failures.

This reverts commit 323270451d.
2023-09-05 15:18:09 +01:00
Stephen Tozer
323270451d Reapply "[Dexter] Remove builder from Dexter"
Fixes a test which was broken on the green dragon buildbot, and further
failures on the SIE buildbot.

This reverts commit 8df9eff90f.
2023-09-05 13:59:53 +01:00
Jonas Devlieghere
a902015f54 [lldb] Fix grammar in error message emitted by IRExecutionUnit
The error message "Couldn't lookup symbols" emitted from IRExecutionUnit
is grammatically incorrect. "Lookup" is noun when spelled without a
space. Update the error message to use the verb "look up" instead.
2023-08-24 14:11:30 -07:00
Stephen Tozer
8df9eff90f Revert "[Dexter] Remove builder from Dexter"
& Revert "[Dexter] Fix incorrect substitution errors in clang-cl builder"

This reverts commits 262520a3c5,
and 0b72b71cd3.

Failures occurred on two buildbots, the SIE buildbot:
https://lab.llvm.org/buildbot/#/builders/216/builds/26006

And the green dragon buildbot:
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/59091

Errors appear to be related to incorrect tool substitution in the Dexter
test commands, and a currently unknown error with one of the general
debuginfo tests that uses Dexter.
2023-08-21 18:06:27 +01:00
Stephen Tozer
0b72b71cd3 [Dexter] Fix incorrect substitution errors in clang-cl builder
Following 262520a3, tests on windows bots began failing due to an incorrect
substitution in the previous patch, where clang-cl was used instead of
clang_cl.

Also fixes an inconsistency in the builders used for some of the tests
in 'dexter-tests', where %clang++ was used for some tests and %clang for
tests that should have identical RUN lines.
2023-08-21 17:21:36 +01:00
Stephen Tozer
262520a3c5 [Dexter] Remove builder from Dexter
See "discussion":
  https://discourse.llvm.org/t/rfc-dexter-feature-removals/60462

This patch removes the builder functionality from Dexter, as it is an active
maintenance burden and is no longer required since Dexter is being invoked by
other test runners that can handle the build step better, and there has been no
objection that it is still needed.

Differential Revision: https://reviews.llvm.org/D151465
2023-08-21 15:08:11 +01:00
Jonas Devlieghere
9c4660629c [Dexter] XFAIL Dexter tests for Apple Silicon (arm64) 2023-05-26 15:43:20 -07:00
Jonas Devlieghere
7adff65d4a [Dexter] Don't hardcode x86_64 as the default architecture
Use platform.machine() as the default architecture instead of hardcoding
it to x86_64.
2023-05-26 15:06:58 -07:00
Tobias Hieta
f98ee40f4b [NFC][Py Reformat] Reformat python files in the rest of the dirs
This is an ongoing series of commits that are reformatting our
Python code. This catches the last of the python files to
reformat. Since they where so few I bunched them together.

Reformatting is done with `black`.

If you end up having problems merging this commit because you
have made changes to a python file, the best way to handle that
is to run git checkout --ours <yourfile> and then reformat it
with black.

If you run into any problems, post to discourse about it and
we will try to help.

RFC Thread below:

https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Reviewed By: jhenderson, #libc, Mordante, sivachandra

Differential Revision: https://reviews.llvm.org/D150784
2023-05-25 11:17:05 +02:00
Thomas Lively
c672c3fe05 [WebAssembly] Add wasm_simd128.h intrinsics for relaxed SIMD
Add user-friendly intrinsic functions for all relaxed SIMD instructions
alongside the existing SIMD128 intrinsic functions in wasm_simd128.h. Test that
the new instrinsics lower to the expected instructions in the existing
cross-project-tests test file.

Reviewed By: aheejin, sbc100

Differential Revision: https://reviews.llvm.org/D150833
2023-05-18 08:24:58 -07:00
Stephen Tozer
ee5617dc71 [Dexter] Add timeout options
Adds a pair of options for Dexter that allow the user to specify a
timeout duration. These options are:

* --timeout-total: Times out if the total run-time of the debugger session
  exceeds <timeout-total> seconds.
* --timeout-breakpoint: Times out if the time without hitting a
  breakpoint exceeds <timeout-breakpoint> seconds.

Reviewed By: Orlando

Differential Revision: https://reviews.llvm.org/D145063
2023-03-22 13:50:00 +00:00
Stephen Tozer
73a01952b5 [Dexter] Add a simple logging class to Dexter
Adds a basic logging class to Dexter that uses the existing PrettyOutput
class for printing and supports 3 levels of verbosity (note, warning,
error). Intended to consolidate the logging logic for Dexter into one
place, removing the need for conditional log statements and making it
easier for us later if we wish to use a more complete logging class.

Reviewed By: Orlando

Differential Revision: https://reviews.llvm.org/D144983
2023-03-15 19:25:37 +00:00
Stephen Tozer
2e7f339389 [Dexter] Add target_run_args option
Adds an option to Dexter that passes command line arguments to the
debugged process, following (and in addition to) any arguments given by
the DexCommandLine command.

Differential Revision: https://reviews.llvm.org/D144979
2023-03-15 17:11:30 +00:00
Stephen Tozer
6376c5b976 [Dexter] Use non-blocking resume when debugging Visual Studio
The Visual Studio debugger currently uses blocking calls to Go and
StepInto, which interferes with Dexter's ability to do any processing
(e.g. checking for time outs) in between breakpoints. This patch updates
these functions to use non-blocking calls.

Reviewed By: Orlando

Differential Revision: https://reviews.llvm.org/D144986
2023-03-01 12:09:12 +00:00
Diana Picus
58dada5f0a [AMDGPU] Add cross-project-tests for WMMA builtins
Add a few tests to make sure we get the expected instruction for the
WMMA builtins (and generally that our builtins and intrinsics are on the
same page and won't blow up).

Differential Revision: https://reviews.llvm.org/D144176
2023-02-17 09:20:46 +01:00
Adrian Prantl
e07452d931 Walk back an overly-aggressive unXFAIL. 2023-02-03 17:22:32 -08:00
Adrian Prantl
867735f286 UnXFAIL test. 2023-02-03 16:25:16 -08:00
Adrian Prantl
0981ff8968 Upgrade llgdb script for Python 3 compatibility. 2023-02-03 16:06:09 -08:00
Adrian Prantl
02513a43f4 Update llgdb to use python3. 2023-02-03 12:54:38 -08:00
Ben Mudd
03c45f14bf [Dexter] Add on_line parameter to DexExpectStepOrder command
DexExpectStepOrder uses the line to expect a debugger step from the actual line
of the command in the Dexter source file. Now Dexter scripts have mainly moved
to thier own script files instead of the actual source, there should be a
option to override this behaviour to choose your own debugger step location.

Reviewed By: Orlando

Differential Revision: https://reviews.llvm.org/D142099
2023-01-19 15:11:26 +00:00
Kazu Hirata
9f72b78be5 [cross-project-tests] Use std::optional instead of llvm::Optional (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-14 20:56:10 -08:00
Paul Robinson
f0f6182941 [llgdb-tests] Convert test to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
2023-01-04 07:56:37 -08:00
Kazu Hirata
13f489e750 [cross-project-tests] Use std::nullopt instead of llvm::None (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-10 17:37:55 -08:00
Guozhi Wei
e5244706ec [dexter-tests] Add attribute optnone to main function
The test case optnone-simple-functions.cpp is expected to be compiled
unoptimized even under -O2 because of attribute optnone. But this attribute is
missed for main function, and caused the fail in
https://lab.llvm.org/buildbot/#/builders/217/builds/14046 when it triggered
optimizations. This patch fixes that by adding attribute optnone to main
function.

Differential Revision: https://reviews.llvm.org/D136778
2022-10-26 20:57:49 +00:00
Jonas Devlieghere
2234f582c9 [dexter] Temporary disable optnone-simple-functions
D136396 broke optnone-simple-functions. Temporary disabling the test to
unblock the bot until the Sony folks can have a look.

https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/47878/
2022-10-26 13:14:44 -07:00
OCHyams
251e614019 [Dexter] Ignore step information in __libc_start_call_main
The test dexter/feature_tests/commands/perfect/expect_step_kind/direction.cpp
was failing on a machine because __libc_start_call_main was not identified as a
"frame below main" (a frame we don't want to gather information from), causing
dexter to count one more step than expected in the test.

Add __libc_start_call_main to the list of "frames below main". There may
be a more robust way of doing this but this is a pragmatic solution we can
use for now.
2022-10-12 12:21:56 +01:00
Pavel Samolysov
1c530500ab [Pipelines] Introduce DAE after ArgumentPromotion
The ArgumentPromotion pass uses Mem2Reg promotion at the end to cutting
down generated `alloca` instructions as well as meaningless `store`s and
this behavior can leave unused (dead) arguments. To eliminate the dead
arguments and therefore let the DeadCodeElimination remove becoming dead
inserted `GEP`s as well as `load`s and `cast`s in the callers, the
DeadArgumentElimination pass should be run after the ArgumentPromotion
one.

Differential Revision: https://reviews.llvm.org/D128830
2022-09-22 15:33:46 -07:00
Adrian Prantl
5203168f91 Revert "[debuginfo-tests] Un-XFAIL no passing unused-merged-value.c test"
This reverts commit 96f00f63b2 because D128830 has been reverted.
2022-09-02 08:47:37 -07:00
Michael Buch
96f00f63b2 [debuginfo-tests] Un-XFAIL no passing unused-merged-value.c test
This test would previously expect one of the parameters to have
an incorrect DW_AT_location. Stepping through `fun` with a debugger
would then no reflect updates to one of the parameters.

With a recent change to Clang's DeadArgumentEliminationPass
(see `879f5118fc74657e4a5c4eff6810098e1eed75ac`) the generated
DWARF does not contain a location for `parama`, and stepping through
the function with `lldb` works as expected.

Differential Revision: https://reviews.llvm.org/D132664
2022-08-25 16:43:40 +01:00
Felipe de Azevedo Piovezan
920e2e8271 [cross-project] Disable debug-types-section tests on Apple systems
The -fdebug-types-section flag is not supported on Apple platforms.

Reviewed By: Michael137

Differential Revision: https://reviews.llvm.org/D132410
2022-08-24 07:31:29 -04:00
Shafik Yaghmour
b364535304 [Clang] Diagnose ill-formed constant expression when setting a non fixed enum to a value outside the range of the enumeration values
DR2338 clarified that it was undefined behavior to set the value outside the
range of the enumerations values for an enum without a fixed underlying type.

We should diagnose this with a constant expression context.

Differential Revision: https://reviews.llvm.org/D130058
2022-07-28 15:27:50 -07:00
Arthur Eubanks
f6a7d7e45f [cross-project-tests] Add split-file as dependency
simplified_template_names_noncanonical_type_units.cpp uses split-file.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D130656
2022-07-27 12:44:12 -07:00
David Blaikie
63f4cfe267 Pretty printer test fixes 2022-07-12 19:29:38 +00:00
David Blaikie
4ca2058552 Add missing include for std::size_t 2022-07-12 01:41:10 +00:00
spupyrev
b444358126 Revert "Rebase: [Facebook] Add clang driver options to test debug info and BOLT"
This reverts commit f921985a29.
2022-07-11 09:50:46 -07:00
Amir Ayupov
f921985a29 Rebase: [Facebook] Add clang driver options to test debug info and BOLT
Summary:
This is an essential piece of infrastructure for us to be
continuously testing debug info with BOLT. We can't only make changes
to a test repo because we need to change debuginfo tests to call BOLT,
hence, this diff needs to sit in our opensource repo. But when upstreaming
to LLVM, this should be kept BOLT-only outside of LLVM. When upstreaming,
we need to git diff and check all folders that are being modified by our
commits and discard this one (and leave as an internal diff).

To test BOLT in debuginfo tests, configure it with -DLLVM_TEST_BOLT=ON.
Then run check-lldb and check-debuginfo.

Manual rebase conflict history:
https://phabricator.intern.facebook.com/D29205224
https://phabricator.intern.facebook.com/D29564078
https://phabricator.intern.facebook.com/D33289118
https://phabricator.intern.facebook.com/D34957174

Test Plan:
tested locally
Configured with:
-DLLVM_ENABLE_PROJECTS="clang;lld;lldb;compiler-rt;bolt;debuginfo-tests"
-DLLVM_TEST_BOLT=ON
Ran test suite with:
ninja check-debuginfo
ninja check-lldb

Reviewers: #llvm-bolt

Subscribers: ayermolo, phabricatorlinter

Differential Revision: https://phabricator.intern.facebook.com/D35317341

Tasks: T92898286
2022-07-11 09:31:51 -07:00
Stephen Tozer
6bc2ad235a [Dexter] Remove debugger-dependent test from windows
One of the tests added in the recent floating point patch involves
string comparison against the debugger output; as DbgEng and LLDB have
different output, the test cannot pass against both of them, so disable
it on windows.
2022-06-13 19:27:34 +01:00
Stephen Tozer
ec7c959671 [Dexter] Fix incorrect test expectations for floating point tests
A pair of tests had incorrect expectations set, one being an off-by-one
error and the other using decimal points in the expect that lldb omits.
2022-06-13 19:07:18 +01:00
Stephen Tozer
30bb659c6f [Dexter] Allow Dexter watch commands to specify a range of acceptable FP values
This patch adds an optional argument to DexExpectWatchBase, float_range,
which defines a +- acceptance range for expected floating point values.
If passed, this assumes every expected value to be a floating point
value, and an exception will be thrown if this is not the case.

Differential Revision: https://reviews.llvm.org/D124511
2022-06-13 14:44:28 +01:00
Stephen Tozer
b03451bb9a [Dexter] Use PurePath to compare paths in Dexter commands
Prior to this patch, when comparing the paths of source files in Dexter
commands, we would use os.samefile. This function performs actual file
operations and requires the files to exist on the current system; this
is suitable when running the test for the first time, but renders the
DextIR output files non-portable, and unusable if the source files no
longer exist in their original location.

Differential Revision: https://reviews.llvm.org/D127099
2022-06-08 16:28:27 +01:00
Stephen Tozer
2a156f6058 [Dexter] Catch value error when encountering invalid address
The DexDeclareAddress command checks the value of a variable at a
certain point in the debugged program, and saves that value to be used
in other commands. If the value at that point is not a valid address
however, it currently causes an error in Dexter when we try to cast it -
this is fixed in this patch by catching the error and leaving the
address value unresolved.

Differential Revision: https://reviews.llvm.org/D127101
2022-06-08 16:05:29 +01:00