<div class="gmail_quote">On Mon, Jan 9, 2012 at 11:28 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":29o">Index: test/CodeGen/atomic_init.c<br>
===================================================================<br>
--- test/CodeGen/atomic_init.c  (revision 0)<br>
+++ test/CodeGen/atomic_init.c  (revision 0)<br>
@@ -0,0 +1,12 @@<br>
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep 'store atomic' | count 0<br>
+<br>
+// Check that no atomic operations are used in any initialisation of _Atomic<br>
+// types.<br>
+<br>
+_Atomic(int) i = 42;<br>
+<br>
+void foo()<br>
+{<br>
+  _Atomic(int) j = 12;<br>
+  __atomic_init(&j, 42);<br>
+}<br>
<br>
It should be easy enough to write a complete test for this function that<br>
verifies that it's done with a simple store.</div></blockquote></div><br><div>And in general, please use FileCheck rather than grep even for simple tests to make the next maintainer's life easier.</div>