-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Test program:
void herp_derp() {}
[[gnu::alias("_Z9herp_derpv")]] void frobble();
int main() {
frobble();
}
Clang and GCC compile and link this successfully. But ClangIR doesn't process the alias
attribute and fails to link:
$ cir alias.cpp
/usr/bin/ld: /tmp/alias-7b2e15.o: in function `main':
/local/home/dolsen/upstream/llvm-project/test/alias.cpp:4: undefined reference to `frobble()'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
The bug can be seen in the LLVM IR. Clang creates an alias directive for frobble
:
@_Z7frobblev = dso_local alias void (), ptr @_Z9herp_derpv
while ClangIR merely declares the function:
declare !dbg !8 void @_Z7frobblev()
bcardosolopes and lanza
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working