12 Commits

Author SHA1 Message Date
Cullen Rhodes
ce6303f0e6 [lli] Fix crash on empty entry-function
Empty entry-function triggers the following assertion:

  llvm/lib/IR/Mangler.cpp:38: void getNameWithPrefixImpl(llvm::raw_ostream
  &, const llvm::Twine &, (anonymous namespace)::ManglerPrefixTy, const
  llvm::DataLayout &, char):

  Assertion `!Name.empty() && "getNameWithPrefix requires non-empty name"' failed.

Throw an error if entry-function is empty.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D156516
2023-07-31 09:29:54 +00:00
Lang Hames
1fb99dedd7 [lli] Reference global @C in global-variable-alignment testcase.
We want to reference both byte-sized globals (@A and @C) to prevent them from
being dead-stripped.
2023-05-16 16:14:01 -07:00
Lang Hames
563ce9aa4a [lli] Add new testcases for lli.
These are an attempt to more systematically test the features covered by the
MCJIT regression tests (though these tests apply to lli's default mode, which
is now -jit-kind=orc).

This first batch of tests includes a basic smoke test (trivial-return-zero),
tests for single function calls and data references, and alignment handling.
2023-05-12 15:40:04 +10:00
Jonas Hahnfeld
50ca8b3e87 [ORC] Drop Comdat when discarding IR symbol
According to the IR verifier, "Declaration[s] may not be in a Comdat!"

This is a re-commit of 76b3f0b4d5a0b8c54147c4c73a30892bbca76467 and
87d7838202267a011639fcbf97263556ccf091dc with updates to the test:
 * Force emission of the extra-module, to trigger the bug after D138264,
   by providing a second symbol @g, and making the comdat nodeduplicate.
   (Technically only one is needed, but two should be safer.)
 * Name the comdat $f to avoid failure on Windows:
   LLVM ERROR: Associative COMDAT symbol 'c' does not exist.
 * Mark the test as UNSUPPORTED on macOS, MachO doesn't support COMDATs.

Differential Revision: https://reviews.llvm.org/D142443
2023-02-05 10:53:36 +01:00
Jonas Hahnfeld
76d94d3eed Revert "[ORC] Drop Comdat when discarding IR symbol"
A number of AArch64 bots report errors in clang-repl, for example
https://lab.llvm.org/buildbot/#/builders/197/builds/3920

This reverts commit 87d7838202267a011639fcbf97263556ccf091dc.
2023-02-04 21:26:36 +01:00
Lang Hames
7e528d4689 [ORC] Make weak-comdat.ll testcase UNSUPPORTED on Darwin, rather than XFAIL. 2023-02-03 12:04:06 -08:00
Jonas Hahnfeld
de7e9ebe46 [Orc] XFAIL test with Comdats on macOS
The bots report:
LLVM ERROR: MachO doesn't support COMDATs, 'f' cannot be lowered.
2023-02-03 16:33:57 +01:00
Jonas Hahnfeld
87d7838202 [ORC] Drop Comdat when discarding IR symbol
According to the IR verifier, "Declaration[s] may not be in a Comdat!"

This is a re-commit of 76b3f0b4d5a0b8c54147c4c73a30892bbca76467 with
updates to the test:
 * Force emission of the extra-module, to trigger the bug after D138264,
   by providing a second symbol @g, and making the comdat nodeduplicate.
   (Technically only one is needed, but two should be safer.)
 * Name the comdat $f to avoid failure on Windows:
   LLVM ERROR: Associative COMDAT symbol 'c' does not exist.

Differential Revision: https://reviews.llvm.org/D142443
2023-02-03 11:16:19 +01:00
Jonas Hahnfeld
e5dd58e3a6 Revert "[ORC] Drop Comdat when discarding IR symbol"
Failure on Windows:
LLVM ERROR: Associative COMDAT symbol 'c' does not exist.

This reverts commit 76b3f0b4d5a0b8c54147c4c73a30892bbca76467 while
I investigate the problem and a solution that still triggers the
original problem.
2023-02-03 10:04:38 +01:00
Jonas Hahnfeld
76b3f0b4d5 [ORC] Drop Comdat when discarding IR symbol
According to the IR verifier, "Declaration[s] may not be in a Comdat!"

Differential Revision: https://reviews.llvm.org/D142443
2023-02-03 08:41:58 +01:00
Matt Arsenault
2d56d8c4e8 ExecutionEngine: Convert tests to opaque pointers 2022-12-05 11:12:17 -05:00
Lang Hames
a76209c265 [ORC] Fix handling of casts in llvm.global_ctors.
Removes a bogus dyn_cast_or_null that was breaking cast-expression handling when
parsing llvm.global_ctors.

The intent of this code was to identify Functions nested within cast
expressions, but the offending dyn_cast_or_null was actually blocking that:
Since a function is not a cast expression, we would set FuncC to null and break
the loop without finding the Function. The cast was not necessary either:
Functions are already Constants, and we didn't need to do anything
ConstantExpr-specific with FuncC, so we could just drop the cast.

Thanks to Jonas Hahnfeld for tracking this down.

http://llvm.org/PR54797
2022-04-07 17:06:38 -07:00