kda updated this revision to Diff 434634.
kda marked an inline comment as done.
kda added a comment.

removed braces on single statement from conditional


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127145/new/

https://reviews.llvm.org/D127145

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  compiler-rt/test/msan/Linux/b64.cpp
  compiler-rt/test/msan/Linux/dn_expand.cpp
  compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp
  compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp


Index: compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp
===================================================================
--- compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp
+++ compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp
@@ -1,7 +1,4 @@
-// RUN: %clangxx %s -o %t -lresolv && %run %t %p
-
-// -lresolv fails on Android.
-// UNSUPPORTED: android
+// RUN: %clangxx %s -o %t && %run %t %p
 
 #include <assert.h>
 #include <resolv.h>
Index: compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp
===================================================================
--- compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp
+++ compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp
@@ -1,7 +1,4 @@
-// RUN: %clangxx %s -o %t -lresolv && %run %t %p
-
-// -lresolv fails on Android.
-// UNSUPPORTED: android
+// RUN: %clangxx %s -o %t && %run %t %p
 
 #include <assert.h>
 #include <resolv.h>
Index: compiler-rt/test/msan/Linux/dn_expand.cpp
===================================================================
--- compiler-rt/test/msan/Linux/dn_expand.cpp
+++ compiler-rt/test/msan/Linux/dn_expand.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx_msan -O0 %s -o %t -lresolv && %run %t
+// RUN: %clangxx_msan -O0 %s -o %t && %run %t
 
 #include <assert.h>
 #include <resolv.h>
Index: compiler-rt/test/msan/Linux/b64.cpp
===================================================================
--- compiler-rt/test/msan/Linux/b64.cpp
+++ compiler-rt/test/msan/Linux/b64.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx_msan -O0 %s -o %t -lresolv && %run %t
+// RUN: %clangxx_msan -O0 %s -o %t && %run %t
 // RUN: not %run %t NTOP_READ 2>&1 | FileCheck %s --check-prefix=NTOP_READ
 // RUN: not %run %t PTON_READ 2>&1 | FileCheck %s --check-prefix=PTON_READ
 
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -838,6 +838,9 @@
       TC.getTriple().isOSNetBSD() ||
       TC.getTriple().isOSOpenBSD())
     CmdArgs.push_back("-lexecinfo");
+  // There is no libresolv on Android.
+  if (!TC.getTriple().isAndroid())
+    CmdArgs.push_back("-lresolv");
 }
 
 static void


Index: compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp
===================================================================
--- compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp
+++ compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp
@@ -1,7 +1,4 @@
-// RUN: %clangxx %s -o %t -lresolv && %run %t %p
-
-// -lresolv fails on Android.
-// UNSUPPORTED: android
+// RUN: %clangxx %s -o %t && %run %t %p
 
 #include <assert.h>
 #include <resolv.h>
Index: compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp
===================================================================
--- compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp
+++ compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp
@@ -1,7 +1,4 @@
-// RUN: %clangxx %s -o %t -lresolv && %run %t %p
-
-// -lresolv fails on Android.
-// UNSUPPORTED: android
+// RUN: %clangxx %s -o %t && %run %t %p
 
 #include <assert.h>
 #include <resolv.h>
Index: compiler-rt/test/msan/Linux/dn_expand.cpp
===================================================================
--- compiler-rt/test/msan/Linux/dn_expand.cpp
+++ compiler-rt/test/msan/Linux/dn_expand.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx_msan -O0 %s -o %t -lresolv && %run %t
+// RUN: %clangxx_msan -O0 %s -o %t && %run %t
 
 #include <assert.h>
 #include <resolv.h>
Index: compiler-rt/test/msan/Linux/b64.cpp
===================================================================
--- compiler-rt/test/msan/Linux/b64.cpp
+++ compiler-rt/test/msan/Linux/b64.cpp
@@ -1,4 +1,4 @@
-// RUN: %clangxx_msan -O0 %s -o %t -lresolv && %run %t
+// RUN: %clangxx_msan -O0 %s -o %t && %run %t
 // RUN: not %run %t NTOP_READ 2>&1 | FileCheck %s --check-prefix=NTOP_READ
 // RUN: not %run %t PTON_READ 2>&1 | FileCheck %s --check-prefix=PTON_READ
 
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -838,6 +838,9 @@
       TC.getTriple().isOSNetBSD() ||
       TC.getTriple().isOSOpenBSD())
     CmdArgs.push_back("-lexecinfo");
+  // There is no libresolv on Android.
+  if (!TC.getTriple().isAndroid())
+    CmdArgs.push_back("-lresolv");
 }
 
 static void
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to