<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Apr 3, 2018 at 4:01 PM Alex L via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">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"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 3 April 2018 at 14:30, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span class="m_-8499229502554567089gmail-"><div dir="ltr">On Tue, Apr 3, 2018 at 1:52 PM Alex Lorenz 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Author: arphaman<br>
Date: Tue Apr  3 13:50:05 2018<br>
New Revision: 329110<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=329110&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=329110&view=rev</a><br>
Log:<br>
[driver][darwin] Do not infer -simulator environment for non-simulator SDKs<br></blockquote><div><br></div></span><div>I know you added a REQUIRES line to these tests, but I think there is a much better way:</div><span class="m_-8499229502554567089gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
--- cfe/trunk/test/Driver/darwin-sdkroot.c (original)<br>
+++ cfe/trunk/test/Driver/darwin-sdkroot.c Tue Apr  3 13:50:05 2018<br>
@@ -51,12 +51,21 @@<br>
 // CHECK-IPHONE: "-triple" "arm64-apple-ios8.0.0"<br>
 // CHECK-IPHONE: ld<br>
 // CHECK-IPHONE: "-iphoneos_version_min" "8.0.0"<br>
+// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang %s -### 2>&1 \<br></blockquote><div><br></div></span><div>Instead of just running %clang, actually pass the `-target` you want to it like we do in the below invocation and the other invocations in this file.</div><div><br></div><div>We shouldn't lose driver testing on other systems as long as you can specify the desired target.</div></div></div></blockquote><div><br></div><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hi Chandler!<div><br></div><div>Thanks for pointing this out! We actually can't use -target here because when -target is specified, Darwin's driver won't infer the triple's environment from the SDKROOT. So this test covers the path in the driver that won't be taken when -target is specified.</div></div></div></div></div></blockquote><div><br></div><div>Ah, I see, that's where the inference is triggered. Sure.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>You've made a good point about losing testing though. I can split out this test into the original file (with -target use) and the new tests which can't use -target and are Darwin specific to ensure we won't loose the existing coverage. I will commit a follow-up commit that does this.</div></div></div></div></blockquote><div><br></div><div>Sure, makes sense to factor out inference-based tests where possible and cover as much as you can w/o inference.</div><div><br></div><div>Thanks for explaining!</div></div></div>