JonChesterfield added a comment.

cstdlib test header contains

  // amdgcn already provides definition of fabs
  #ifndef __AMDGCN__
  float fabs(float __x) { return __builtin_fabs(__x); }
  #endif

If I delete or invert the ifndef

> $HOME/llvm-build/llvm/lib/clang/13.0.0/include/__clang_hip_cmath.h:660:9: 
> error: target of using declaration conflicts with declaration already in scope
>  using ::fabs;
>  when included from openmp_wrappers/cmath

If I delete the definition,

> $HOME/llvm-project/clang/test/Headers/Inputs/include/cstdlib:29:31: error: 
> use of undeclared identifier 'fabs'
> when included from openmp_wrappers/__clang_openmp_device_functions.h

Current conclusion is that we cannot work around the presence/absence of fabs 
in the cstdlib test file, we have to do something in the real headers such that 
the test file does the right thing


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104904/new/

https://reviews.llvm.org/D104904

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to