[PATCH] D12099: Fix FREM on 32-bit MSVC on x86
Dylan McKay via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 18 08:37:13 PDT 2015
dylanmckay added inline comments.
================
Comment at: test/CodeGen/X86/frem-msvc32.ll:7
@@ +6,3 @@
+; CHECK: @do_frem32
+; CHECK: calll _fmod
+define float @do_frem32(float %a, float %b) {
----------------
mbodart wrote:
> As written, this test will pass without your compiler changes as _fmod is a substring of _fmodf.
>
> It needs to either incorporate CHECK-NOT fmodf, or use a regular expression that matches _fmod but not _fmodf. Perhaps this:
>
> ; CHECK: calll {{_fmod$}}
I had trouble with this.
If you remove the `-mtriple=i686-pc-windows-msvc` flag to `llc`, `fmodf` is generated, and the test does fail as expected.
I tried `CHECK-NOT: fmodf`, which worked well, but I feel that the test should check that `fmod` is being called, as opposed to checking that any arbitrary function except `fmodf` is being called.
I like the regexp solution you give - it both makes sure that `fmodf` isn't being called, and `fmod` is. I will update the patch and use it - thanks!
I will also remove the `calll` instruction, as it makes the test unnecessarily brittle (what if LLVM selects a different function call instruction in the future) .
http://reviews.llvm.org/D12099
More information about the llvm-commits
mailing list