<div dir="ltr">Sure thing. I'll expand the test to verify that frontend emit expected IR for this case.<div>Thank you for the feedback</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 5, 2017 at 9:58 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, May 31, 2017 at 5:45 PM Gor Nishanov via Phabricator via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">GorNishanov created this revision.<br>
<br>
Coroutine related test that used to trigger broken IR prior to r304335.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D33750" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D33750</a><br>
<br>
Files:<br>
  test/CodeGenCoroutines/coro-<wbr>await-domination.cpp<br>
<br>
<br>
Index: test/CodeGenCoroutines/coro-<wbr>await-domination.cpp<br>
==============================<wbr>==============================<wbr>=======<br>
--- /dev/null<br>
+++ test/CodeGenCoroutines/coro-<wbr>await-domination.cpp<br>
@@ -0,0 +1,38 @@<br>
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcoroutines-ts -std=c++14 -emit-llvm %s -o - | FileCheck %s </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+#include "Inputs/coroutine.h"<br>
+<br>
+using namespace std::experimental;<br>
+<br>
+struct coro {<br>
+  struct promise_type {<br>
+    coro get_return_object();<br>
+    suspend_never initial_suspend();<br>
+    suspend_never final_suspend();<br>
+    void return_void();<br>
+    static void unhandled_exception();<br>
+  };<br>
+};<br>
+<br>
+struct A {<br>
+  ~A();<br>
+  bool await_ready();<br>
+  int await_resume() { return 8; }<br>
+  template <typename F> void await_suspend(F);<br>
+};<br>
+<br>
+extern "C" void consume(int);<br>
+<br>
+// Verifies that domination is properly built during cleanup.<br>
+// Without CGCleanup.cpp fix verifier was reporting:<br>
+// Instruction does not dominate all uses!<br>
+//  %tmp.exprcleanup = alloca i32*, align 8<br>
+//  store i32* %x, i32** %tmp.exprcleanup, align 8<br>
+<br>
+<br>
+// CHECK-LABEL: f(<br></blockquote><div><br>This doesn't seem to check much. Should this test check that the IR instructions have the 'good' layout, more than that the verifier doesn't fail?<br><br>Or is that already tested by the test case added in r304335? In that case I wouldn't add this test. If the change can/is tested in isolation in Clang, that should be sufficient/tends to be how testing is done in the regression test suites in the LLVM project. (the test-suite is the place for broader/end-to-end testing)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+extern "C" coro f(int) {<br>
+  int x = 42;<br>
+  x = co_await A{};<br>
+  consume(x);<br>
+}<br>
+<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div>
</blockquote></div><br></div>