Eric Fiselier <[email protected]> writes:
> I'm not opposed to the change but using Filecheck really hurts our ability to
> test standalone.
> Also, we don't have that many compilation failures tests. I'm not sure how
> badly this change is needed.

Using clang -verify avoids that issue, but there's still the matter of
having to update almost 300 tests to use it.

Here's a quick example of hackily adding a verify flag instead of
checking for rc 1 in the lit.cfg and updating the test under discussion:

diff --git a/test/lit.cfg b/test/lit.cfg
index 4fc082a..a04fdb7 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -116,8 +116,12 @@ class LibcxxTestFormat(lit.formats.FileBasedTest):
         if expected_compile_fail:
             cmd = [self.cxx_under_test, '-c',
                    '-o', '/dev/null', source_path] + self.cpp_flags
+            expected_exit_code = 1
+            if 'clang' in self.cxx_under_test:
+                cmd += ['-Xclang', '-verify']
+                expected_exit_code = 0
             out, err, exitCode = self.execute_command(cmd)
-            if exitCode == 1:
+            if exitCode == expected_exit_code:
                 return lit.Test.PASS, ""
             else:
                 report = """Command: %s\n""" % ' '.join(["'%s'" % a
diff --git a/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp b/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp
index 00a08bc..140b203 100644
--- a/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp
+++ b/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp
@@ -19,8 +19,9 @@
 
 class Deleter
 {
-
-    Deleter() {}
+    // expected-error@memory:* {{base class 'Deleter' has private default constructor}}
+    // expected-note@memory:* + {{in instantiation of member function}}
+    Deleter() {} // expected-note {{implicitly declared private here}}
 
 public:
 
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to