Implement the export pragma that is used in the z/OS XL C/C++ compiler
to indicate that an external symbol is to be exported from the shared
library. The syntax for the pragma is:
```
'#pragma' 'export' '(' name ')'
```
For C++ if `name` is a function it needs to be declared `extern "C"`.
See the following for the XL documentation:
- https://www.ibm.com/docs/en/zos/3.1.0?topic=descriptions-pragma-export
This code was originally in PR
https://github.com/llvm/llvm-project/pull/111035. I have split it out
into separate PRs so the code for #pragma export is in one PR and the
code for _Export keyword is in another. See that original PR for earlier
comments.
12 lines
321 B
C++
12 lines
321 B
C++
// REQUIRES: systemz-registered-target
|
|
// RUN: %clang_cc1 -x c++ -emit-llvm -triple s390x-none-zos -fvisibility=hidden %s -o - | FileCheck %s
|
|
|
|
#pragma export(a) export(b) export(c)
|
|
int a,b,c;
|
|
|
|
void foo(void);
|
|
|
|
// CHECK: @a = global i32 0, align 4
|
|
// CHECK: @b = global i32 0, align 4
|
|
// CHECK: @c = global i32 0, align 4
|