Issue |
52788
|
Summary |
Segfault when clang run with empty llvm pass plugin -g and a specific source file
|
Labels |
new issue
|
Assignees |
|
Reporter |
hoodmane
|
I am trying to run clang with a custom pass plugin. I am using
```sh
Debian clang version 13.0.1-++20211216073009+87ca22cba2fa-1~exp1~20211216193049.38
```
installed from apt https://apt.llvm.org/
My empty plugin is as follows:
```C++
#include "llvm/Passes/PassPlugin.h"
using namespace llvm;
extern "C" LLVM_ATTRIBUTE_WEAK ::llvm::PassPluginLibraryInfo
llvmGetPassPluginInfo() {
return {LLVM_PLUGIN_API_VERSION, "my-empty-plugin", LLVM_VERSION_STRING, [](PassBuilder &PB) {}};
}
```
clang crashes on the following input file:
```C
typedef void (*F)(int*);
int test(F f)
{
int d;
f(&d);
return 0;
}
```
when invoked as follows:
```sh
clang -O1 -g -fpass-plugin=myEmptyPlugin.so -c src/test.c -o src/test.o
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs