[cfe-commits] Some improvements to atomics

Chandler Carruth chandlerc at google.com
Mon Jan 9 23:36:15 PST 2012


On Mon, Jan 9, 2012 at 11:28 PM, John McCall <rjmccall at apple.com> wrote:

> Index: test/CodeGen/atomic_init.c
> ===================================================================
> --- test/CodeGen/atomic_init.c  (revision 0)
> +++ test/CodeGen/atomic_init.c  (revision 0)
> @@ -0,0 +1,12 @@
> +// RUN: %clang_cc1 -emit-llvm %s -o - | grep 'store atomic' | count 0
> +
> +// Check that no atomic operations are used in any initialisation of
> _Atomic
> +// types.
> +
> +_Atomic(int) i = 42;
> +
> +void foo()
> +{
> +  _Atomic(int) j = 12;
> +  __atomic_init(&j, 42);
> +}
>
> It should be easy enough to write a complete test for this function that
> verifies that it's done with a simple store.
>

And in general, please use FileCheck rather than grep even for simple tests
to make the next maintainer's life easier.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120109/d0d1501f/attachment.html>


More information about the cfe-commits mailing list