On Mon, Mar 25, 2013 at 6:18 PM, John Thompson <span dir="ltr"><<a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: jtsoftware<br>
Date: Mon Mar 25 20:18:28 2013<br>
New Revision: 177960<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=177960&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=177960&view=rev</a><br>
Log:<br>
Added simple regression test for modularize.<br>
<br>
Added:<br>
clang-tools-extra/trunk/test/modularize/<br>
clang-tools-extra/trunk/test/modularize/InputNoProblems/<br>
clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeDecls.h<br>
clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeTypes.h<br>
clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/<br>
clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header1.h<br>
clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header2.h<br>
clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/<br>
clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header1.h<br>
clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header2.h<br>
clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/SubHeader.h<br></blockquote><div><br></div><div>Please move these to a subdirectory named exactly "Inputs".</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
clang-tools-extra/trunk/test/modularize/NoProblems.cpp<br>
clang-tools-extra/trunk/test/modularize/ProblemsDuplicate.cpp<br>
clang-tools-extra/trunk/test/modularize/ProblemsInconsistent.cpp<br></blockquote><div><br></div><div>Please give these files an extension other than .cpp -- they aren't C++! You can set the extensions which lit will look at in test/lit.cfg.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Modified:<br>
clang-tools-extra/trunk/test/CMakeLists.txt<br>
<br>
Modified: clang-tools-extra/trunk/test/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/CMakeLists.txt?rev=177960&r1=177959&r2=177960&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/CMakeLists.txt?rev=177960&r1=177959&r2=177960&view=diff</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/CMakeLists.txt (original)<br>
+++ clang-tools-extra/trunk/test/CMakeLists.txt Mon Mar 25 20:18:28 2013<br>
@@ -22,7 +22,7 @@ set(CLANG_TOOLS_TEST_DEPS<br>
clang clang-headers FileCheck count not<br>
<br>
# Individual tools we test.<br>
- remove-cstr-calls cpp11-migrate<br>
+ remove-cstr-calls cpp11-migrate modularize<br>
)<br>
<br>
add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"<br>
<br>
Added: clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeDecls.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeDecls.h?rev=177960&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeDecls.h?rev=177960&view=auto</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeDecls.h (added)<br>
+++ clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeDecls.h Mon Mar 25 20:18:28 2013<br>
@@ -0,0 +1,5 @@<br>
+// Declare a couple of functions - no modules problems.<br>
+<br>
+void FuncOne();<br>
+<br>
+int FuncTwo(int arg);<br>
<br>
Added: clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeTypes.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeTypes.h?rev=177960&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeTypes.h?rev=177960&view=auto</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeTypes.h (added)<br>
+++ clang-tools-extra/trunk/test/modularize/InputNoProblems/SomeTypes.h Mon Mar 25 20:18:28 2013<br>
@@ -0,0 +1,16 @@<br>
+// Define a few different kinds of types - no modules problems.<br>
+<br>
+typedef int TypeInt;<br>
+<br>
+typedef TypeInt NestedTypeInt;<br>
+<br>
+struct TypeStruct {<br>
+ int Member;<br>
+};<br>
+<br>
+class TypeClass {<br>
+public:<br>
+ TypeClass() : Member(0) {}<br>
+private:<br>
+ int Member;<br>
+};<br>
<br>
Added: clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header1.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header1.h?rev=177960&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header1.h?rev=177960&view=auto</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header1.h (added)<br>
+++ clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header1.h Mon Mar 25 20:18:28 2013<br>
@@ -0,0 +1,2 @@<br>
+// Same decl as in Header2.h.<br>
+typedef int TypeInt;<br>
<br>
Added: clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header2.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header2.h?rev=177960&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header2.h?rev=177960&view=auto</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header2.h (added)<br>
+++ clang-tools-extra/trunk/test/modularize/InputProblemsDuplicate/Header2.h Mon Mar 25 20:18:28 2013<br>
@@ -0,0 +1,2 @@<br>
+// Same decl as in Header1.h.<br>
+typedef int TypeInt;<br>
<br>
Added: clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header1.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header1.h?rev=177960&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header1.h?rev=177960&view=auto</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header1.h (added)<br>
+++ clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header1.h Mon Mar 25 20:18:28 2013<br>
@@ -0,0 +1,4 @@<br>
+// Define symbol such that a declaration exists when this header<br>
+// is included, but not when Header2.h is included.<br>
+#define SYMBOL1 1<br>
+#include "SubHeader.h"<br>
<br>
Added: clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header2.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header2.h?rev=177960&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header2.h?rev=177960&view=auto</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header2.h (added)<br>
+++ clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/Header2.h Mon Mar 25 20:18:28 2013<br>
@@ -0,0 +1,3 @@<br>
+// Set up so the declaration in SubHeader.h is not defined.<br>
+#define SYMBOL2 1<br>
+#include "SubHeader.h"<br>
<br>
Added: clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/SubHeader.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/SubHeader.h?rev=177960&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/SubHeader.h?rev=177960&view=auto</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/SubHeader.h (added)<br>
+++ clang-tools-extra/trunk/test/modularize/InputProblemsInconsistent/SubHeader.h Mon Mar 25 20:18:28 2013<br>
@@ -0,0 +1,11 @@<br>
+// Set up so TypeInt only defined during Header1.h include.<br>
+#ifdef SYMBOL1<br>
+#define SYMBOL 1<br>
+#endif<br>
+#ifdef SYMBOL2<br>
+#define SYMBOL 2<br>
+#endif<br>
+<br>
+#if SYMBOL == 1<br>
+typedef int TypeInt;<br>
+#endif<br>
<br>
Added: clang-tools-extra/trunk/test/modularize/NoProblems.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/NoProblems.cpp?rev=177960&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/NoProblems.cpp?rev=177960&view=auto</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/modularize/NoProblems.cpp (added)<br>
+++ clang-tools-extra/trunk/test/modularize/NoProblems.cpp Mon Mar 25 20:18:28 2013<br>
@@ -0,0 +1,5 @@<br>
+# RUN: modularize %s -x c++<br>
+# RUN: modularize -prefix=%p %s -x c++<br>
+<br>
+InputNoProblems/SomeTypes.h<br>
+InputNoProblems/SomeDecls.h<br>
<br>
Added: clang-tools-extra/trunk/test/modularize/ProblemsDuplicate.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/ProblemsDuplicate.cpp?rev=177960&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/ProblemsDuplicate.cpp?rev=177960&view=auto</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/modularize/ProblemsDuplicate.cpp (added)<br>
+++ clang-tools-extra/trunk/test/modularize/ProblemsDuplicate.cpp Mon Mar 25 20:18:28 2013<br>
@@ -0,0 +1,6 @@<br>
+# RUN: modularize %s -x c++ 2>&1 | FileCheck %s<br>
+<br>
+InputProblemsDuplicate/Header1.h<br>
+InputProblemsDuplicate/Header2.h<br>
+<br>
+# CHECK: error: 'TypeInt' defined at both {{.*}}{{[/\\]}}InputProblemsDuplicate{{[/\\]}}Header1.h:2:13 and {{.*}}{{[/\\]}}InputProblemsDuplicate{{[/\\]}}Header2.h:2:13<br>
<br>
Added: clang-tools-extra/trunk/test/modularize/ProblemsInconsistent.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/ProblemsInconsistent.cpp?rev=177960&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/modularize/ProblemsInconsistent.cpp?rev=177960&view=auto</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/modularize/ProblemsInconsistent.cpp (added)<br>
+++ clang-tools-extra/trunk/test/modularize/ProblemsInconsistent.cpp Mon Mar 25 20:18:28 2013<br>
@@ -0,0 +1,10 @@<br>
+# RUN: modularize %s -x c++ 2>&1 | FileCheck %s<br>
+<br>
+InputProblemsInconsistent/Header1.h<br>
+InputProblemsInconsistent/Header2.h<br>
+<br>
+# CHECK: error: 'SYMBOL' defined at both {{.*}}{{[/\\]}}InputProblemsInconsistent{{[/\\]}}SubHeader.h:3:9 and {{.*}}{{[/\\]}}InputProblemsInconsistent/SubHeader.h:6:9<br>
+# CHECK-NEXT: error: header '{{.*}}{{[/\\]}}InputProblemsInconsistent{{[/\\]}}SubHeader.h' has different contents dependening on how it was included<br>
+# CHECK-NEXT: note: 'SYMBOL' in {{.*}}{{[/\\]}}InputProblemsInconsistent{{[/\\]}}SubHeader.h at 3:9 not always provided<br>
+# CHECK-NEXT: note: 'SYMBOL' in {{.*}}{{[/\\]}}InputProblemsInconsistent{{[/\\]}}SubHeader.h at 6:9 not always provided<br>
+# CHECK-NEXT: note: 'TypeInt' in {{.*}}{{[/\\]}}InputProblemsInconsistent{{[/\\]}}SubHeader.h at 10:13 not always provided<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br>