mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 12:19:23 +08:00
Implements https://github.com/llvm/wg-hlsl/blob/main/proposals/0026-symbol-visibility.md. The change is to stop using the `hlsl.export` attribute. Instead, symbols with "program linkage" in HLSL will have export linkage with default visibility, and symbols with "external linkage" in HLSL will have export linkage with hidden visibility.
19 lines
430 B
HLSL
19 lines
430 B
HLSL
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
|
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s
|
|
|
|
// CHECK: define void @_Z2f1v() [[Attr:\#[0-9]+]]
|
|
export void f1() {
|
|
}
|
|
|
|
// CHECK: define void @_ZN11MyNamespace2f2Ev()
|
|
namespace MyNamespace {
|
|
export void f2() {
|
|
}
|
|
}
|
|
|
|
export {
|
|
// CHECK: define void @_Z2f3v()
|
|
// CHECK: define void @_Z2f4v()
|
|
void f3() {}
|
|
void f4() {}
|
|
} |