<div dir="ltr">Hi all,<div><br></div><div>I have a issue when I'm running "extendhfsf2_test.c" (in "compiler-rt/test/builtins/Unit") with llvm9.0.1.</div><div>I'm getting this output message (and the test return 1):</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>error in test__extendhfsf2(0x7e00) = nan, expected nan</div></blockquote><div><div><br></div><div>I'm compile the test by hand ("clang -O2 extendhfsf2_test.c -o extendhfsf2_test")</div><div>I've also looked at the generated asm code, and it seems that clang decided at compile time that the test will fail as it will always print the message and return 1 as shown below:</div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">0000000000400580 main:<br>  400580: 50                            pushq   %rax<br>  400581: bf 00 7e 00 00                movl    $32256, %edi<br>  400586: e8 25 00 00 00                callq   37 <__extendhfsf2><br>  40058b: f3 0f 5a c0                   cvtss2sd        %xmm0, %xmm0<br>  40058f: f2 0f 10 0d 21 01 00 00       movsd   289(%rip), %xmm1<br>  400597: bf c0 06 40 00                movl    $4196032, %edi<br>  40059c: be 00 7e 00 00                movl    $32256, %esi<br>  4005a1: b0 02                         movb    $2, %al<br>  4005a3: e8 58 fe ff ff                callq   -424 <printf@plt><br>  4005a8: b8 01 00 00 00                movl    $1, %eax<br>  4005ad: 59                            popq    %rcx<br>  4005ae: c3                            retq<br>  4005af: 90                            nop<br></blockquote><div><br></div><div>If I force the compiler to do the test at runtime (by adding a "__attribute__((noinline))" at the right place in the code), the test return with success.</div><div><br></div>Am I doing something wrong here? Or it is a known bug?<div><br><div>Thanks,</div><div>Romaric</div></div></div>