140 Commits

Author SHA1 Message Date
Stephen Tozer
2334fd2ea3 [Dexter] Update Dexter tests to use new dexter test substitutions
Following commit b8fc288, which changed some dexter test substitutions to
be specific to C and C++, some tests that had been added since the original
patch was written were still using the old substitution; this patch updates
them to use the new.
2025-04-03 16:05:42 +01:00
Stephen Tozer
b8fc288c46
[Dexter] Replace clang with clang++ in various cross project tests (#65987)
This patch replaces invocations of clang with clang++ for a set of
c++ files in the dexter cross-project tests. As a small additional change,
this patch removes -lstdc++ from a test that did not appear to require it.
2025-04-03 15:37:43 +01:00
Vladislav Dzhidzhoev
bcad050106
[llvm-objdump][ARM] Find ELF file PLT entries for arm, thumb (#130764)
This implements arm, armeb, thumb, thumbeb PLT entries parsing support
in ELF for llvm-objdump.

Implementation is similar to AArch64MCInstrAnalysis::findPltEntries. PLT
entry signatures are based on LLD code for PLT generation
(ARM::writePlt).

llvm-objdump tests are produced from lld/test/ELF/arm-plt-reloc.s,
lld/test/ELF/armv8-thumb-plt-reloc.s.
2025-03-26 20:18:23 +01:00
Augusto Noronha
7cabcdb2d2
[debuginfo-tests] Use built lldb for testing if available (#131681)
The cross-project-tests's debuginfo-tests don't rely on lldb being built
to run. While this is a good, a bug in the system lldb can cause a test
to fail with no way of fixing it. This patch makes it so the tests use
the built lldb instead if it's available.
2025-03-19 12:42:47 -07:00
Shilei Tian
746d8b0740
[Clang][AMDGPU] Use 32-bit index for SWMMAC builtins (#129101)
Currently, the index of SWMMAC builtins is of type `short`, likely based
on the
assumption that K can only be up to 32, meaning there are only 16
non-zero
elements. However, this is not future-proof. This patch updates all of
them to
`int`.

The intrinsics themselves don't need to be updated since they accept any
integer
type, and in the backend, they are already extended to 32-bit.
Additionally, the
tests already use various kinds of integers.

Partially fixes SWDEV-518183.
2025-02-27 23:28:48 -05:00
Jeremy Morse
1ed359e682
[Dexter] Remove clang-opt-bisect analyzer tool (#128165)
The idea behind this tool was that you'd instrument a source file to
measure its debug-info quality, then watch as it progressively got worse
with more optimisations being enabled in clang. However we've since
stripped the "building" portions of Dexter out as they were ill placed,
which makes this tooling redundant. The lack of __init__.py adjacent to
it means it couldn't be run anyway.

The core idea behind this is still sound; just it's best placed on the
other side of the build system, something that Dexter shouldn't try to
solve.
2025-02-24 11:56:51 +00:00
Eisuke Kawashima
a1a3e019d7
[cross-project-tests] Fix invalid escape sequences (#94031)
These generate a SyntaxWarning with Python 3.12.
2025-01-13 13:15:22 +01:00
Eisuke Kawashima
ca92bdfa3e
[cross-project-tests] Use "is" instead of "==" to check for None (#94016)
From PEP8
(https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
is not, never the equality operators.
2025-01-13 13:03:04 +01:00
Stephen Tozer
23309d7d95
[Dexter] Set up ComInterface module to be imported correctly (#111850)
Fixes issue added by: https://github.com/llvm/llvm-project/pull/111833

Following the previous commit that changed how Dexter imports modules,
the ComInterface module import became broken. This is because it had a
different directory structure to other modules, where we want to import
single file rather than a dir containing a __init__.py. For this case,
an optional extra arg has been added to load_module allowing a filename
to be specified, letting us import ComInterface.py directly and fixing
the issue.
2024-10-10 16:53:36 +01:00
Stephen Tozer
6779376ee9
[Dexter] Remove outdated imp dependency (#111833)
Fixes: https://github.com/llvm/llvm-project/issues/111815

This patch replaces usage of the python `imp` library, which is
deprecated since python3.4 and removed in python3.12, with the
`importlib` library. As part of this update the repeated
find_module+load_module pattern is moved into a utility function, since
the importlib equivalent is much more verbose.
2024-10-10 14:38:07 +01:00
Jason Molenda
93e45a69dd
[Dexter] Adapt to upcoming lldb stepping behavior (#108127)
lldb will change how it reports stop reasons around breakpoints in the
near future. I landed an earlier version of this change and noticed
debuginfo test failures on the CI bots due to the changes. I'm
addressing the issues found by CI at
https://github.com/llvm/llvm-project/pull/105594 and will re-land once
I've done all of them.

Currently, when lldb stops at a breakpoint instruction -- but has not
yet executed the instruction -- it will overwrite the thread's Stop
Reason with "breakpoint-hit". This caused bugs when the original stop
reason was important to the user - for instance, a watchpoint on an
AArch64 system where we have to instruction-step past the watchpoint to
find the new value. Normally we would instruction step, fetch the new
value, then report the user that a watchpoint has been hit with the old
and new values. But if the instruction after this access is a breakpoint
site, we overwrite the "watchpoint hit" stop reason (and related
actions) with "breakpoint hit".

dexter sets breakpoints on all source lines, then steps line-to-line,
hitting the breakpoints. But with this new behavior, we see two steps
per source line: The first step gets us to the start of the next line,
with a "step completed" stop reason. Then we step again and we execute
the breakpoint instruction, stop with the pc the same, and report
"breakpoint hit". Now we can step a second time and move past the
breakpoint.

I've changed the `step` method in LLDB.py to check if we step to a
breakpoint site but have a "step completed" stop reason -- in which case
we have this new breakpoint behavior, and we need to step a second time
to actually hit the breakpoint like the debuginfo tests expect.
2024-09-11 16:09:48 -07:00
Brendan Dahl
5703d8572f
[WebAssembly] Add intrinsics to wasm_simd128.h for all FP16 instructions (#106465)
Getting this to work required a few additional changes:
- Add builtins for any instructions that can't be done with plain C
currently.
- Add support for the saturating version of fp_to_<s,i>_I16x8. Other
vector sizes supported this already.
- Support bitcast of f16x8 to v128. Needed to return a __f16x8 as
v128_t.
2024-08-30 08:42:37 -07:00
Stephen Tozer
57dc09341e
[Dexter] Sanitize user details from git repo URL in dexter --version (#105533)
Currently the output of dexter --version contains the raw output of `git
remote get-url origin`, which may contain a username and password. This
patch adds a small change to remove these from the output string. A
similar patch for LLVM's default version string* also removes the git
URL altogether unless opted-in to; it's not clear whether this is a
necessary or desirable step yet, but if so we can trivially remove the
URL from Dexter as well.

*PR here: https://github.com/llvm/llvm-project/pull/105220
2024-08-22 10:56:28 +01:00
dyung
9374216d4b
Replace distutils.version with packaging.version since the former was deprecated in python 3.10 and removed in 3.12. (#99852)
Attempt to reland #99549, but using packaging.version instead of
looseversion, based on the usage used for LLDB in #93712.
2024-07-22 11:28:11 -07:00
Jonas Devlieghere
2572a76f23
Revert "Replace distutils.version with looseversion since the former was deprecated in python 3.10 and removed in 3.12." (#99786)
Reverts llvm/llvm-project#99549 because it breaks a bunch of build bots.
2024-07-20 14:57:23 -07:00
dyung
1492e5f1d5
Replace distutils.version with looseversion since the former was deprecated in python 3.10 and removed in 3.12. (#99549)
Python deprecated the distutils package in 3.10, and removed it in 3.12
causing problems when trying to run the lit tests with 3.12.

https://docs.python.org/3.10/library/distutils.html

Replace usage with the looseversion package which should be a drop-in
replacement for the original usage.

If your testing fails after this commit, you need to install the looseversion package.
2024-07-20 12:08:35 -07:00
David Blaikie
1c9a81b2bd Fix gdb pretty printers for libSupport
Remove the testing for std::optional - it was originally for
llvm::Optional, but now that that doesn't exist and we use
std::optional, testing for that pretty printer should live, wherever the
pretty printer lives, not here in LLVM.

And the PointerIntPair pretty printer bit rotted due to changes in
PointerIntPair, 875391728c11339c8a6cd3338bcaa5ec0ffc2496.
2024-06-19 05:50:08 +00:00
Orlando Cazalet-Hyams
832b91fcb9
[dexter] Correctly identify stop-reason while driving VisualStudio (#94754)
Prior to this patch VisualStudio._get_step_info incorrectly identifies
the reason the debugger has stopped. e.g., stepping through a program
would be reported as a StopReason.Breakpoint rather than
StopReason.Step.

Fix. No test added as there are no VisualStudio tests (tested locally).
2024-06-10 08:47:39 +01:00
Jonas Devlieghere
70550cd6aa
[x-project tests] Fix ambiguity in call to createStringError (NFC)
Fixes:

  https://lab.llvm.org/buildbot/#/builders/139/builds/66928/
  https://lab.llvm.org/buildbot/#/builders/216/builds/40166/
2024-06-05 11:05:33 -07:00
Michael Kruse
e14f5f225a
Revise IDE folder structure (#89755)
Update the folder titles for targets in the monorepository that have not
seen taken care of for some time. These are the folders that targets are
organized in Visual Studio and XCode
(`set_property(TARGET <target> PROPERTY FOLDER "<title>")`)
when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically
deduce the folder. This reduces the number of
`set_property`/`set_target_property`, but are still necessary when
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's
root CMakeLists.txt.
2024-05-25 17:41:21 +02:00
Jay Foad
1650f1b3d7
Fix typo "indicies" (#92232) 2024-05-15 13:10:16 +01:00
Jie Fu
63a2969301 [cross-project-tests] Update code to use mlir::cast (NFC)
/llvm-project/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp:41:16:
 error: 'cast' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations]
    VectorType.cast<mlir::ShapedType>(), llvm::ArrayRef<float>{2.0f, 3.0f});
               ^
/llvm-project/llvm/../mlir/include/mlir/IR/Types.h:345:9: note: 'cast' has been explicitly marked deprecated here
U Type::cast() const {
        ^
/llvm-project/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp:41:16:
 error: 'cast<mlir::ShapedType>' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations]
    VectorType.cast<mlir::ShapedType>(), llvm::ArrayRef<float>{2.0f, 3.0f});
               ^
/llvm-project/llvm/../mlir/include/mlir/IR/Types.h:112:5: note: 'cast<mlir::ShapedType>' has been explicitly marked deprecated here
  [[deprecated("Use mlir::cast<U>() instead")]]
    ^
2 errors generated.
2024-05-01 10:28:29 +08:00
Stephen Tozer
4b5b7eca0e
[Dexter] Add VisualStudio2022 support to Dexter (#85248)
Dexter currently supports Visual Studio 2015/2017/2019, but not 2022;
this patch adds support for 2022.
2024-03-14 18:10:14 +00:00
dyung
5a744776bb
Mark test as XFAIL that started failing after 418f0066eb. (#85027)
Similar failures were previously seen and XFAILed in
https://reviews.llvm.org/D118468.

See the phabricator review for a description of the problem, and the
linked discourse thread for what the failing output looks like.

This change should fix the issue on two buildbots that are running older
versions of GDB:
- https://lab.llvm.org/buildbot/#/builders/217/builds/37559
- https://lab.llvm.org/buildbot/#/builders/247/builds/15173
2024-03-13 11:10:03 +00:00
Adrian Prantl
64111831ed Relax test to work with newer versions of lldb 2024-03-12 17:01:15 -07:00
Adrian Prantl
418f0066eb Modernize llgdb script and make it easier to debug. 2024-03-12 16:12:19 -07:00
Adrian Prantl
422d240dc9 Relax tests to also work with newer versions of lldb.
- result variables are optional
- static members may print their values
- public/protected shows up in ptype output
2024-03-12 16:12:19 -07:00
Adrian Prantl
536e0ebaaa Remove XFAIL from tests passing on green dragon 2024-03-12 11:06:23 -07:00
dyung
69b8bc7111
[Dexter] Extend XFAIL of Dexter tests to all MacOS architectures. (#83936)
I am trying to bring up a MacOS buildbot targeting x86 and noticed that
two Dexter tests were failing,
cross-project-tests/debuginfo-tests/llgdb-tests/static-member.cpp and
cross-project-tests/debuginfo-tests/llgdb-tests/static-member-2.cpp.
Looking in the history for these tests, they were XFAILed for Apple
Silicon in 9c46606 and are failing similar on x86 for me, so we should extend
the XFAIL to all MacOS architectures.
2024-03-07 17:43:12 -05:00
Mirko Brkušanin
7fdf608cef
[AMDGPU] Add GFX12 WMMA and SWMMAC instructions (#77795)
Co-authored-by: Petar Avramovic <Petar.Avramovic@amd.com>
Co-authored-by: Piotr Sobczak <piotr.sobczak@amd.com>
2024-01-24 13:43:07 +01:00
Amir Ayupov
9fec33aadc Revert "[BOLT] Fix unconditional output of boltedcollection in merge-fdata (#78653)"
This reverts commit 82bc33ea3f1a539be50ed46919dc53fc6b685da9.

Accidentally pushed unrelated changes.
2024-01-18 19:59:09 -08:00
Amir Ayupov
82bc33ea3f
[BOLT] Fix unconditional output of boltedcollection in merge-fdata (#78653)
Fix the bug where merge-fdata unconditionally outputs boltedcollection 
line, regardless of whether input files have it set.

Test Plan:
Added bolt/test/X86/merge-fdata-nobat-mode.test which fails without this
fix.
2024-01-18 19:44:16 -08:00
Stephen Tozer
e1c0e7e515
[Dexter] Set ShouldBuild=false for Visual Studio solutions (#75045)
Since Dexter no longer intends to build any code, the ShouldBuild
property in any Visual Studio project being run by Dexter should be
false to ensure that a build step is never invoked by Dexter, whether
the project has already been built or not.

Reviewed by: OCHyams
2023-12-11 15:19:40 +00:00
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
(0d2860b795879f4dd152963b52f969b53b136899) 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 e6cc7b723f244f52663b6d67a5d94597109da1ef 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 37a20cc68f54. 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 5647f2908de90fe07b0805e988cd2e91a1751928.
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 323270451d8db24f2c816f455b3d8f70f434286d.
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 8df9eff90ff8c79e3e508cce7fec1cd897487069.
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 262520a3c5450fd7f149438245b2aef12736347f,
and 0b72b71cd3c8ad824342c05bc6d9d64d87eeb81b.

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