[cfe-dev] CodeGen/atomic.c fails on 64-bit systems

Chris Lattner clattner at apple.com
Sat May 9 10:32:24 PDT 2009


On May 9, 2009, at 8:38 AM, Sebastian Redl wrote:

> Hi,
>
> The test CodeGen/atomic.c fails on 64-bit systems. It expects three
> calls to llvm.atomic.cmp.swap.i32, but one of these cmp-swap calls is
> done on pointers, so obviously results in an i64 version to be  
> called on
> 64-bit systems.
>
> There are several solutions I can see:
> 1) Force the test to a 32-bit target.

I think this is the most straight-forward and best solution, I'll  
commit a patch to do this.

-Chris

>
> 2) Do the test twice, once for 32-bit and once for 64-bit, and do
> different greps in the two cases.
> 3) Somehow change the greps based on target.
> 4) Remove the .i32 suffix on the grep for cmp.swap. We'd then also  
> have
> to filter declarations out, or we get the wrong count.
>
> I personally would favor option 4. Change this line of the RUN:
> // RUN: grep @llvm.atomic.cmp.swap.i32 %t1 | count 4 &&
> to
> // RUN: grep @llvm.atomic.cmp.swap %t1 | grep -v declare | count 3 &&
>
> Sebastian
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list