-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 76b3f0b and 87d7838 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 (cherry picked from commit 50ca8b3)
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
define i32 @g() { | ||
entry: | ||
ret i32 0 | ||
} | ||
|
||
$f = comdat nodeduplicate | ||
|
||
define i32 @f() comdat { | ||
entry: | ||
%0 = call i32 @g() | ||
ret i32 %0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
; RUN: lli -extra-module %p/Inputs/weak-comdat-def.ll %s | ||
; UNSUPPORTED: target={{.*}}-darwin{{.*}} | ||
|
||
declare i32 @g() | ||
|
||
$f = comdat nodeduplicate | ||
|
||
define weak i32 @f() comdat { | ||
entry: | ||
%0 = call i32 @g() | ||
ret i32 %0 | ||
} | ||
|
||
define i32 @main() { | ||
entry: | ||
%0 = call i32 @f() | ||
ret i32 %0 | ||
} |