[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 11 02:39:12 PDT 2024


tbaederr wrote:

> > Can you add a test that passes a non-float value and checks that it's rejected?
> 
> Do you mean something like this?
> 
> ```
> $ cat xx.c 
> #include <math.h>
> 
> float f(char *a, char *b) {
>         return fminimum_num(a, b);
> }
> $ ./bin/clang -std=c23 -O2 -S -emit-llvm xx.c 
> xx.c:4:22: error: passing 'char *' to parameter of incompatible type 'double'
>     4 |         return fminimum_num(a, b);
>       |                             ^
> /usr/include/x86_64-linux-gnu/bits/mathcalls.h:409:40: note: passing argument to parameter '__x' here
>   409 | __MATHCALLX (fminimum_num,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
>       |                                        ^
> 1 error generated.
> ```

Yes, but also with an integer please


https://github.com/llvm/llvm-project/pull/96281


More information about the cfe-commits mailing list