Commit Graph

110 Commits

Author SHA1 Message Date
Andrew Savonichev 0f1b5f115a [NVPTX] Integrate ptxas to LIT tests
ptxas is a proprietary compiler from Nvidia that can compile PTX to
machine code (SASS). It has a lot of diagnostics to catch errors
in PTX, which can be used to verify PTX output from llc.

Set -DPXTAS_EXECUTABLE=/path/to/ptxas CMake option to enable it.
If this option is not set, then ptxas is substituted to true which
effectively disables all ptxas RUN lines.

LLVM_PTXAS_EXECUTABLE environment variable takes precedence over
the CMake option, and allows to override ptxas executable that is used for LIT
without complete re-configuration.

Differential Revision: https://reviews.llvm.org/D121727
2022-04-28 14:59:45 +03:00
Chris Bieneman f2526c1a5c Add DXIL Bitcode Writer and DXIL testing
This change is a big blob of code that isn't easy to break up. It
either comes in all together as a blob, works and has tests, or it
doesn't do anything.

Logically you can think of this patch as three things:
(1) Adding virtual interfaces so the bitcode writer can be overridden
(2) Adding a new bitcode writer implementation for DXIL
(3) Adding some (optional) crazy CMake goop to build the
DirectXShaderCompiler's llvm-dis as dxil-dis for testing

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D122082
2022-04-15 18:50:26 -05:00
Daniil Kovalev 62a983ebc5 Revert "[CodeGen] Place SDNode debug ID declaration under appropriate #if"
This reverts commit 83a798d4b0.

As discussed in D120714 with @thakis, the patch added unneeded complexity
without noticeable benefits.
2022-04-06 20:32:53 +03:00
Daniil Kovalev 83a798d4b0 [CodeGen] Place SDNode debug ID declaration under appropriate #if
Place PersistentId declaration under #if LLVM_ENABLE_ABI_BREAKING_CHECKS to
reduce memory usage when it is not needed.

Differential Revision: https://reviews.llvm.org/D120714
2022-04-06 14:09:32 +03:00
Igor Kudrin c344d97a12 [NVPTX][tests] Do not run tests that require direct object generation
NVPTX does not support generating binary files, which is required for
these tests.

The majority of tests in 'DebugInfo/Generic' also require emitting
object files, so they all are disabled for NVPTX.

Differential Revision: https://reviews.llvm.org/D121996
2022-03-22 16:46:48 +04:00
Igor Kudrin 568404e897 [tests] Make 'object-emission' imply 'default_triple'
If 'config.target_triple' is empty, there is no sense to define the
'object-emission' tag.

Differential Revision: https://reviews.llvm.org/D121994
2022-03-22 16:46:48 +04:00
Jessica Paquette ded733bd49 Add a tool for diffing size remarks
This is a tool which can handle bitstream and YAML remarks. The idea here is to
provide more insight into which functions changed in a benchmark when testing
compiler changes.

E.g. "foo got 20% bigger, so maybe we should look more closely at that."

To use the tool, you can use...

```
$ llvm-remark-size-diff remarks_file_a remarks_file_b --parser=yaml|bitstream
```

... on two remarks files containing at least instruction count remarks. This
will output some data on instruction count change and also other relevant
information such as stack size change from `remarks_file_a` to `remarks_file_b`.

This is a bit of a WIP so I'm happy to change the format etc. Ultimately I think
it'd be best to have some JSON output which could be consumed by another tool.
But some base-level, greppable output is very handy to have anyway.

The format I'm proposing here is

```
<files> <inc/dec in inst count> <fn name> <inst count change> <stack B change>
```

Where the files and increase/decrease are indicated like below:

- `<files>` is one of `++` (file B), `--` (file A), `==` (both)
- `<inc/dec in inst count>` is one of `>` (increase) or `<` (decrease)

This makes it easy to grep for things like "which functions appeared in A but
did not appear in B?" Or "what are all the instruction count decreases?"

Differential Revision: https://reviews.llvm.org/D112940
2022-02-02 16:09:54 -08:00
Mircea Trofin 30c17e70a4 [MLGO] Don't run the 'release' mode tests in non-autogenerated cases 2022-01-19 17:59:06 -08:00
Jake Egan fbf52caf58 [AIX] Disable tests that fail because of no 64-bit XCOFF object file support
The modified tests fail because 64-bit XCOFF object files are not currently supported on AIX. This patch disables these tests on 64-bit AIX for now.

This patch is similar to D111887 except the failures on this patch are on a 64-bit build.

Reviewed By: shchenz, #powerpc

Differential Revision: https://reviews.llvm.org/D113049
2022-01-09 12:25:24 -05:00
Noah Shutty f0ca8d2461 [llvm] [Debuginfo] Add llvm-debuginfod-find tool and end-to-end-tests.
This implements the `llvm-debuginfod-find` tool, which wraps the Debuginfod library (D112758) to query debuginfod servers for artifacts according to the [[ https://www.mankier.com/8/debuginfod#Webapi | specification ]].

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D112759
2021-12-14 18:00:18 +00:00
Noah Shutty 0f30012def Revert "[llvm] [Debuginfo] Add llvm-debuginfod-find tool and end-to-end-tests."
This reverts commit 350fe22f2a because it
caused buildbot breakages (https://lab.llvm.org/buildbot/#/builders/91/builds/387).
2021-12-10 11:08:15 +00:00
Noah Shutty 350fe22f2a [llvm] [Debuginfo] Add llvm-debuginfod-find tool and end-to-end-tests.
This implements the `llvm-debuginfod-find` tool, which wraps the Debuginfod library (D112758) to query debuginfod servers for artifacts according to the [[ https://www.mankier.com/8/debuginfod#Webapi | specification ]].

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D112759
2021-12-10 10:33:52 +00:00
Vitaly Buka 89a7e4283b [NFC] Disabled few tests with MemoryWithOrigins
They pass regular MemorySanitizer, but hang with origin
tracking.
2021-11-04 18:18:03 -07:00
Jake Egan fa1dd5fdee [AIX] Disable cfi-version test on AIX
`.debug_frame` is not emitted on AIX, so this patch disables the test.

Reviewed By: shchenz, jsji

Differential Revision: https://reviews.llvm.org/D112593
2021-10-31 09:33:13 -04:00
Mircea Trofin 6c76d01011 [mlgo][aot] requrie the model is autogenerated for test determinism
The tests that exercise the 'release' mode, where the model is AOT-ed,
check the output has certain properties, to validate that, indeed, a
different policy from the default one was exercised. For determinism, we
can't reliably check that output for an arbitrary learned policy, since
it could be that policy happens to mimic the default one in that
particular case.

This patch adds a requirement that those tests run only when the model
is autogenerated (e.g. on build bots).

Differential Revision: https://reviews.llvm.org/D111747
2021-10-13 14:02:41 -07:00
serge-sans-paille 2c42a73d6c Add extra check for llvm::Any::TypeId visibility
This check should ensure we don't reproduce the problem fixed by
02df443d28

More accurately, it checks every llvm::Any::TypeId symbol in libLLVM-x.so and
make sure they have weak linkage and are not local to the library, which would
lead to duplicate definition if another weak version of the symbol is defined in
another linked library.

Differential Revision: https://reviews.llvm.org/D109252
2021-09-15 08:32:55 +02:00
David Spickett 6f8c4340c2 [llvm][MC] Disable cfi-version test for Windows on Arm
Like Windows on x86-64, Windows on arm64 uses structured
exception handling, so we don't emit .debug_frame.

See:
https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling?view=msvc-160

Reviewed By: ostannard

Differential Revision: https://reviews.llvm.org/D107440
2021-08-04 11:18:05 +00:00
Fangrui Song db6217a3f7 [test] Add llvm-stress to LLVM_TEST_DEPENDS and lit substitutions
D106430 added a test which needs LLVM_TEST_DEPENDS and lit substitution.
2021-07-22 09:37:01 -07:00
Valentin Churavy 3321f4821e
Reland [Orc] Add verylazy example for C-bindings
This patch relands https://reviews.llvm.org/D104799, but fixes the
memory handling causing leak sanitizer failures.

This reverts commit a56fe117e0.
2021-07-18 21:17:49 +02:00
Valentin Churavy a56fe117e0
Revert "[Orc] Add verylazy example for C-bindings"
Broke ASAN buildbot, will reland with fixes

This reverts commit b5a6ad8c89.
2021-07-18 16:21:37 +02:00
Valentin Churavy b5a6ad8c89
[Orc] Add verylazy example for C-bindings
Still WIP, based on the Kaleidoscope/BuildingAJIT/Chapter4.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D104799
2021-07-18 12:07:16 +02:00
Fangrui Song aa3df8ddcd [test] Avoid llvm-readelf/llvm-readobj one-dash long options and deprecated aliases (e.g. --file-headers) 2021-07-15 10:26:21 -07:00
Valentin Churavy 45e8a0befb
[Orc] At CBindings for LazyRexports
At C bindings and an example for LLJIT with lazy reexports

Differential Revision: https://reviews.llvm.org/D104672
2021-07-01 21:52:05 +02:00
Valentin Churavy 9762f12c6c
[Orc] Run the examples as part of the tests
Enable the Orc C-Bindings for testing.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D104637
2021-06-30 21:45:16 +02:00
Andrew Litteken 9e73f7c8d2 [IRSim] Adding basic implementation of llvm-sim.
This is a similarity visualization tool that accepts a Module and
passes it to the IRSimilarityIdentifier.  The resulting SimilarityGroups
are output in a JSON file.

Tests are found in test/tools/llvm-sim and check for the file not found,
a bad module, and that the JSON is created correctly.

Reviewers: paquette, jroelofs, MaskRay

Recommit of: 15645d044b to fix linking
errors and GN build system.

Differential Revision: https://reviews.llvm.org/D86974
2021-06-23 14:38:58 -05:00
Steven Wu c747b7d1d9 [llvm] Fix lto tests that requires ld64
Since Xcode 13, ld64 requires linking libSystem for all the executable.
Fix the tests that needs to run ld64 by linking libSystem from sysroot.

rdar://77332728

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D104332
2021-06-22 09:21:29 -07:00
Andrew Litteken 8bc0eb4011 Revert "[IRSim] Adding basic implementation of llvm-sim."
This reverts commit f47d00c54b.
2021-06-11 15:44:19 -05:00
Andrew Litteken f47d00c54b [IRSim] Adding basic implementation of llvm-sim.
This is a similarity visualization tool that accepts a Module and
passes it to the IRSimilarityIdentifier.  The resulting SimilarityGroups
are output in a JSON file.

Tests are found in test/tools/llvm-sim and check for the file not found,
a bad module, and that the JSON is created correctly.

Reviewers: paquette, jroelofs, MaskRay

Recommit of: 15645d044b to fix linking
errors.

Differential Revision: https://reviews.llvm.org/D86974
2021-06-11 14:56:41 -05:00
Sam Powell 5b5ab80e31 Reland "[llvm] llvm-tapi-diff"
This is relanding commit d1d36f7ad2 .
This patch additionally addresses failures found in buildbots due to unstable build ordering & post review comments.

This patch introduces a new tool, llvm-tapi-diff, that compares and returns the diff of two TBD files.

Reviewed By: ributzka, JDevlieghere

Differential Revision: https://reviews.llvm.org/D101835
2021-06-09 21:17:34 -07:00
Cyndy Ishida e7b755ecb1 Revert "Reland "[llvm] llvm-tapi-diff""
This reverts commit 20126c9fd4.
The sorting fixes failed to have stable output on different platforms.
2021-06-09 13:48:09 -07:00
Sam Powell 20126c9fd4 Reland "[llvm] llvm-tapi-diff"
This is relanding commit d1d36f7ad2 .
This patch additionally addresses failures found in buildbots & post review comments.

This patch introduces a new tool, llvm-tapi-diff, that compares and returns the diff of two TBD files.

Reviewed By: ributzka, JDevlieghere

Differential Revision: https://reviews.llvm.org/D101835
2021-06-09 10:35:41 -07:00
David Tenty 82d3c0759f [AIX] Add %pluginext and update tests to use proper pluginext
As a follow on to D96282, since bug point passes is built as a module the proper file extension to use is LLVM_PLUGIN_EXT, rather than SHLIBEXT. Using SHLIBEXT causes the tests to load a non-existent file on AIX. We also adjust the PluginsTest unittest  to use LLVM_PLUGIN_EXT for similar reasons.

This change should hopefully make little difference to other platforms, since generally `SHLIBEXT=LTDL_SHLIB_EXT=CMAKE_SHARED_LIBRARY_SUFFIX` and `LLVM_PLUGIN_EXT=CMAKE_SHARED_LIBRARY_SUFFIX` on every platform except AIX.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D101412
2021-04-27 20:34:54 -04:00
Martin Storsjö f8de9aaef2 [llvm-rc] Add a GNU windres-like frontend to llvm-rc
This primarily parses a different set of options and invokes the same
resource compiler as llvm-rc normally. Additionally, it can convert
directly to an object file (which in MSVC style setups is done with the
separate cvtres tool, or by the linker).

(GNU windres also supports other conversions; from coff object file back
to .res, and from .res or object file back to .rc form; that's not yet
implemented.)

The other bigger complication lies in being able to imply or pass the
intended target triple, to let clang find the corresponding mingw sysroot
for finding include files, and for specifying the default output object
machine format.

It can be implied from the tool triple prefix, like
`<triple>-[llvm-]windres` or picked up from the windres option e.g.
`-F pe-x86-64`. In GNU windres, that option takes BFD style format names
such as pe-i386 or pe-x86-64. As libbfd in binutils doesn't support
Windows on ARM, there's no such canonical name for the ARM targets.
Therefore, as an LLVM specific extension, this option is extended to
allow passing full triples, too.

Differential Revision: https://reviews.llvm.org/D100756
2021-04-26 22:04:29 +03:00
Hongtao Yu aaf120b528 [llvm-profgen] A couple tweaks to the testing harness.
1. Remove unnecessary filtering code.
2. Add llvm-profgen to tool substitutions.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D101006
2021-04-22 08:57:14 -07:00
Nico Weber 1a3f88658a [llvm-objdump] Add an llvm-otool tool
This implements an LLVM tool that's flag- and output-compatible
with macOS's `otool` -- except for bugs, but from testing with both
`otool` and `xcrun otool-classic`, llvm-otool matches vanilla
otool's behavior very well already. It's not 100% perfect, but
it's a very solid start.

This uses the same approach as llvm-objcopy: llvm-objdump uses
a different OptTable when it's invoked as llvm-otool. This
is possible thanks to D100433.

Differential Revision: https://reviews.llvm.org/D100583
2021-04-20 08:24:58 -04:00
Nigel Perks 23f8993f32 Restore lit feature object-emission. Omit DebugInfo/Generic on XCore.
D73568 removed the lit feature object-emission, because it was introduced for a
target which did not support the integrated assembler, and that target no longer
required the feature. XCore still does not support the integrated assembler,
so a build with XCore as the default target fails tests requiring
object-emission. This issue was not publicly visible because there was not a
buildbot for XCore as the default target. We fixed the failures downstream. We
now have builder clang-xcore-ubuntu-20-x64 on the staging buildmaster, which
shows the failures. We would like to make upstream build green.

Omit DebugInfo/Generic on XCore to avoid annotating 70 separate files.

Differential Revision: https://reviews.llvm.org/D98508
2021-04-16 13:02:14 +01:00
Stefan Gränitz 030ac786d4 [Orc][examples] Add lit ToolSubst for LLJITWithRemoteDebugging example
The test case added in 258f055ed9 was lacking two important details for the test infrastructure. ae217bf1f3 added the executable to LLVM_TEST_DEPENDS in CMake to make sure the exectubale gets built before we run the test suite. This patch adds a ToolSubst for the executable in LIT, which replaces the tool invokation in the RUN line with an absolute path. It makes sure we don't run accidentally run some other tool from the user's PATH. The test works without it in case LLVM's main binary directory happens to be the working directory (which is default apparently). Configurations that don't build the examples ignore failures for this ToolSubst (and won't run the test).

Reviewed By: echristo

Differential Revision: https://reviews.llvm.org/D99931
2021-04-07 09:47:04 +02:00
Andrew Litteken 0776eca7a4 Revert "[IRSim] Adding basic implementation of llvm-sim."
Causing build errors on the Windows Buildbots.

This reverts commit 5155dff278.
2021-03-20 18:03:09 -05:00
Andrew Litteken 5155dff278 [IRSim] Adding basic implementation of llvm-sim.
This is a similarity visualization tool that accepts a Module and
passes it to the IRSimilarityIdentifier.  The resulting SimilarityGroups
are output in a JSON file.

Tests are found in test/tools/llvm-sim and check for the file not found,
a bad module, and that the JSON is created correctly.

Reviewers: paquette, jroelofs, MaskRay

Recommit of: 15645d044b to fix linking
errors.

Differential Revision: https://reviews.llvm.org/D86974
2021-03-20 16:47:50 -05:00
Djordje Todorovic 9f41c03f82 [Debugify][OriginalDIMode] Export the report into JSON file
By using the original-di check with debugify in the combination with
the llvm/utils/llvm-original-di-preservation.py it becomes very user
friendly tool. An example of the HTML page with the issues
related to debug info can be found at [0].

[0] https://djolertrk.github.io/di-checker-html-report-example/

Differential Revision: https://reviews.llvm.org/D82546
2021-03-11 01:11:13 -08:00
Fangrui Song 87dbdd2e3b [FileCheck] Default --allow-unused-prefixes to false
Link: https://lists.llvm.org/pipermail/llvm-dev/2020-October/146162.html "[RFC] FileCheck: (dis)allowing unused prefixes"

If a downstream project using lit needs time for transition,
add the following to `lit.local.cfg`:

```
from lit.llvm.subst import ToolSubst

fc = ToolSubst('FileCheck', unresolved='fatal')
config.substitutions.insert(0, (fc.regex, 'FileCheck --allow-unused-prefixes'))
```

Differential Revision: https://reviews.llvm.org/D95849
2021-02-08 13:37:04 -08:00
Mircea Trofin c042aff886 [NFC] Disallow unused prefixes under llvm/test
This patch sets the default for llvm tests, with the exception of tests
under Reduce, because quite a few of them use 'FileCheck' as parameter
to a tool, and including a flag as that parameter would complicate
matters.

The rest of the patch undo-es the lit.local.cfg changes we progressively
introduced as temporary measure to avoid regressions under various
directories.

Differential Revision: https://reviews.llvm.org/D95111
2021-01-21 20:31:52 -08:00
Mircea Trofin f9a27df16b [FileCheck] Enforce --allow-unused-prefixes=false for llvm/test/Transforms
Explicitly opt-out llvm/test/Transforms/Attributor.

Verified by flipping the default value of allow-unused-prefixes and
observing that none of the failures were under llvm/test/Transforms.

Differential Revision: https://reviews.llvm.org/D92404
2020-12-09 08:51:38 -08:00
Nico Weber af9bf14e6b Make test/tools/llvm-dlltool/tool-name.test pass, and make it run
The test hasn't run since it was added in D71302.
2020-11-03 11:59:15 -05:00
Alexander Shaposhnikov 5495b69164 [llvm-objcopy][MachO] Add llvm-bitcode-strip driver
This diff adds llvm-bitcode-strip driver to llvm-objcopy.
In the future this will enable us to build a replacement for the tool bitcode_strip.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D87212
2020-09-18 18:13:05 -07:00
jasonliu 1321160a26 Disable a large test for EXPENSIVE_CHECKS and debug build
Summary:
When running a large test in LLVM_ENABLE_EXPENSIVE_CHECKS=ON mode,
buildbot could hit timeout.
Disable the test when this mode is on.
Also disable it for debug so that the test won't hang for too long.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D87794
2020-09-16 21:57:34 +00:00
Petr Hosek c4d7536136 [CMake] Simplify CMake handling for libxml2
This matches the changes made to handling of zlib done in 10b1b4a
where we rely on find_package and the imported target rather than
manually appending the library and include paths. The use of
LLVM_LIBXML2_ENABLED has been replaced by LLVM_ENABLE_LIBXML2
thus reducing the number of variables.

Differential Revision: https://reviews.llvm.org/D84563
2020-09-09 21:44:44 -07:00
Russell Gallop c9455d3c57 [Test] Tidy up loose ends from LLVM_HAS_GLOBAL_ISEL
This hasn't been allowed as a build option since r309990

Remove leftover REQUIRES: global-isel

Differential Revision: https://reviews.llvm.org/D86714
2020-08-27 16:36:27 +01:00
Eric Christopher ea7b1c79f7 Add cmake test support for LLJITWithThinLTOSummaries to make sure
it's being built and called (and substituted).
2020-08-26 11:46:09 -07:00
Fangrui Song bcea3a7a28 Add test utility 'split-file'
See https://lists.llvm.org/pipermail/llvm-dev/2020-July/143373.html
"[llvm-dev] Multiple documents in one test file" for some discussions.

This patch has explored several alternatives. The current semantics are similar to
what @dblaikie proposed.
`split-file filename output` splits the input file into multiple parts separated by
regex `^(.|//)--- filename` and write each part to the file `output/filename`
(`filename` can include path separators).

Use case A (organizing input of different formats (e.g. linker
script+assembly) in one file).

```
# RUN: split-file %s %t
# RUN: llvm-mc %t/asm -o %t.o
# RUN: ld.lld -T %t/lds %t.o -o %t
This is sometimes better than the %S/Inputs/ approach because the user
can see the auxiliary files immediately and don't have to open another file.

# asm
...
# lds
...
```

Use case B (for utilities which don't have built-in input splitting
feature):

```
// RUN: split-file %s %t
// RUN: llc < %t/1.ll | FileCheck %s --check-prefix=CASE1
// RUN: llc < %t/2.ll | FileCheck %s --check-prefix=CASE2
Combing tests prudently can improve readability.
For example, when testing parsing errors if the recovery mechanism isn't possible,
grouping the tests in one file can more readily see test coverage/strategy.

//--- 1.ll
...
//--- 2.ll
...
```

Since this is a new utility, there is no git history concerns for
UpperCase variable names. I use lowerCase variable names like mlir/lld.

Reviewed By: jhenderson, lattner

Differential Revision: https://reviews.llvm.org/D83834
2020-08-03 20:42:09 -07:00