Steven Perron a027eb4472
[HLSL] Use hidden visibility for external linkage. (#140292)
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.
2025-06-16 16:44:55 -04:00

13 lines
518 B
HLSL

// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
// CHECK-LABEL: define hidden noundef i1 {{.*}}fn{{.*}}(i1 noundef %x)
// CHECK: [[X:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[Y:%.*]] = zext i1 {{%.*}} to i32
// CHECK-NEXT: store i32 [[Y]], ptr [[X]], align 4
// CHECK-NEXT: [[Z:%.*]] = load i32, ptr [[X]], align 4
// CHECK-NEXT: [[L:%.*]] = trunc i32 [[Z]] to i1
// CHECK-NEXT: ret i1 [[L]]
bool fn(bool x) {
return x;
}