PGI18.4 LLVM: constructor does not accept program arguments


I try to compile a constructor with program arguments:

checkconstructor(int argc, char* argv[]);

checkconstructor(int argc, char* argv[])

But it fails with:

$ pgcc -V

pgcc 18.10-1 LLVM 64-bit target on x86-64 Linux -tp haswell 
PGI Compilers and Tools
Copyright (c) 2018, NVIDIA CORPORATION.  All rights reserved.
$ pgcc -c conftest.c
…/linux86-64-llvm/18.10/share/llvm/bin/llc: /tmp/pgccPr_e7YbrZTiL.ll:41:103: error: '@checkconstructor' defined with type 'void (i32, i8**)*'
@llvm.global_ctors = appending global [2 x { i32, void ()* }][{ i32, void ()* } { i32 65535, void ()* @checkconstructor }, { i32, void ()* } { i32 65535, void ()* @__daz }]

Note that Clang accepts this since at least version 3.5:

$ clang --version
clang version 3.5.2 (tags/RELEASE_352/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang -c conftest.c


Sorry, wrong section. If possible, that should be moved to ‘General Programming’.