Matt Arsenault fb21f16fe6
RuntimeLibcalls: Add stub API for getting function signatures (#166290)
Eventually this should be generated by tablegen for all functions.
For now add a manually implementation for sincos_stret, which I
have an immediate use for. This will allow pulling repeated code
across targets into shared call sequence code.

Also add sqrt just to make sure we can handle adding return attributes
on the declaration.
2025-11-04 10:06:29 -08:00

20 lines
578 B
LLVM

; RUN: opt -S -passes=declare-runtime-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
; Check an already declared function
; CHECK: declare float @logf(float)
declare float @logf(float)
; Check an already defined function
; CHECK: define float @sinf(float %x) {
define float @sinf(float %x) {
ret float %x
}
; CHECK: declare void @acosf(...)
; CHECK: declare nofpclass(ninf nsub nnorm) float @sqrtf(float) [[SQRT_ATTRS:#[0-9]+]]
; CHECK: declare nofpclass(ninf nsub nnorm) double @sqrt(double) [[SQRT_ATTRS:#[0-9]+]]
; CHECK: declare void @__umodti3(...)