CodeGen/atomic.c fails on 64-bit systems

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.
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

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