Skip to content

add tests for trunc#255

Merged
spall merged 1 commit into
llvm:mainfrom
spall:issue-trunc
Jun 20, 2025
Merged

add tests for trunc#255
spall merged 1 commit into
llvm:mainfrom
spall:issue-trunc

Conversation

@spall

@spall spall commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

add 16 and 32 bit float tests for trunc
closes #119


# REQUIRES: Half
# RUN: split-file %s %t
# RUN: %dxc_target -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not sure if this is a pattern we are following elsewhere, but we could make the shader model be the minimum viable version?

@spall spall merged commit 0be0b73 into llvm:main Jun 20, 2025
10 checks passed
@spall spall deleted the issue-trunc branch September 8, 2025 15:42
Icohedron added a commit that referenced this pull request Apr 23, 2026
…e.so (#1107)

In Windows Subsystem for Linux, libd3d12.so is a shim that dlopen's
libd3d12core.so and uses dlsym to resolve D3D12GetInterface. Due to ELF
symbol interposition, dlsym may resolve back to libd3d12.so's own
export, causing infinite recursion and a stack overflow.

Example:
```
❯ ./api-query
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.      Program arguments: ./api-query
  #0 0x00005555556e960b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/icohedron/hlsl-dev/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
  #1 0x00005555556e70f5 llvm::sys::RunSignalHandlers() /home/icohedron/hlsl-dev/llvm-project/llvm/lib/Support/Signals.cpp:109:18
  #2 0x00005555556ea45a SignalHandler(int, siginfo_t*, void*) /home/icohedron/hlsl-dev/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
  #3 0x00007ffff7442790 __restore_rt (/nix/store/jms7zxzm7w1whczwny5m3gkgdjghmi2r-glibc-2.42-51/lib/libc.so.6+0x42790)
  #4 0x00007ffff7df4a21 (/usr/lib/wsl/lib/libd3d12.so+0xb7a21)
  #5 0x00007ffff7df6b6a (/usr/lib/wsl/lib/libd3d12.so+0xb9b6a)
  #6 0x00007ffff7df8ac6 D3D12GetInterface (/usr/lib/wsl/lib/libd3d12.so+0xbbac6)
  #7 0x00007ffff7df8adf D3D12GetInterface (/usr/lib/wsl/lib/libd3d12.so+0xbbadf)
...
#254 0x00007ffff7df8adf D3D12GetInterface (/usr/lib/wsl/lib/libd3d12.so+0xbbadf)
#255 0x00007ffff7df8adf D3D12GetInterface (/usr/lib/wsl/lib/libd3d12.so+0xbbadf)
Failed to query D3D info queue
Segmentation fault         (core dumped) ./api-query
```

This PR fixes the issue by explicitly linking libd3d12core.so before
libd3d12.so so it appears first in the global symbol table.

Assisted-by: Claude Opus 4.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test for trunc

3 participants