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

Sebastian Redl sebastian.redl at getdesigned.at
Sat May 9 08:38:17 PDT 2009


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



More information about the cfe-dev mailing list