[cfe-commits] r147655 - in /cfe/trunk: lib/CodeGen/CGBuiltin.cpp test/CodeGen/no-builtin.c

David Chisnall csdavec at swan.ac.uk
Fri Jan 6 08:24:39 PST 2012


On 6 Jan 2012, at 16:19, Richard Smith wrote:

> On Fri, January 6, 2012 15:58, David Chisnall wrote:
>> On 6 Jan 2012, at 15:56, Richard Smith wrote:
>>> On Fri, January 6, 2012 15:39, David Chisnall wrote:
>>>> Then I am confused - the test case in the bug report failed for me before
>>>> making that change and passed after that change...
>>> 
>>> Were you running it through FileCheck? It's only checking for 'cos' in the
>>> output, which will naturally exist since you define an extern function with
>>> that name.
>> 
>> Ah, that's a bug in the test then.  I was only checking whether the change
>> fixed the issue in the bug report.
> 
> Nonetheless, that was not the problem I was originally observing. In my tests,
> a call to @cos appears in main with -fno-builtin, and does not appear without,
> for your testcase, with or without your patch. I've tried a freebsd triple,
> and I see the same behavior. Can you give a command-line using -fno-builtin
> for which we do not produce a call to @cos, prior to your patch, so I can see
> if our results match?

I just did:

$ clang testcase.c -fno-builtin
$ ./a.out
not ok
Abort trap: 6 (core dumped)

Then I did:

$ clang testcase.c -fno-builtin -S -emit-llvm

There was no call to cos in the output, the cos(1) was being evaluated at compile time.  I made the change, and then the test passed.

David



More information about the cfe-commits mailing list