[PATCH] D14935: Fix nodefaultlibs/nostdlib check

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 14:29:02 PST 2015

jyknight added a comment.

The commit message could use some work: please summarize what you're actually changing, and why. (Here you mention only vaguely why, and not what.)

Comment at: test/Driver/nodefaultlib_stdc.c:1
@@ +1,2 @@
+// RUN: %clang -stdlib=libc++ -nodefaultlibs -lstdc++ -### %s 2>&1 | FileCheck %s
+// CHECK-NOT: "-lc++"
It's typically preferred to put a test in the same file as related tests -- so, merge nodefaultlib_stdc.c into the nodefaultlib.c file. You can do this without having the assertion lines conflict with each-other by using the "--check-prefix" argument to FileCheck.

This test doesn't specify a target, and thus will run for whatever the default compiled-in target is for each user's clang. Might want to specify a target explicitly to avoid that. Maybe this test actually works for all targets, anyways, but it's probably safer to just specify one. :)


More information about the cfe-commits mailing list