[cfe-commits] r97061 - in /cfe/trunk/test/PCH: Inputs/ Inputs/namespaces.h namespaces.cpp
Douglas Gregor
dgregor at apple.com
Wed Feb 24 13:52:55 PST 2010
Author: dgregor
Date: Wed Feb 24 15:52:55 2010
New Revision: 97061
URL: http://llvm.org/viewvc/llvm-project?rev=97061&view=rev
Log:
Add PCH test for C++ namespaces, missing from a previous commit
Added:
cfe/trunk/test/PCH/Inputs/
cfe/trunk/test/PCH/Inputs/namespaces.h
cfe/trunk/test/PCH/namespaces.cpp
Added: cfe/trunk/test/PCH/Inputs/namespaces.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/Inputs/namespaces.h?rev=97061&view=auto
==============================================================================
--- cfe/trunk/test/PCH/Inputs/namespaces.h (added)
+++ cfe/trunk/test/PCH/Inputs/namespaces.h Wed Feb 24 15:52:55 2010
@@ -0,0 +1,13 @@
+// Header for PCH test namespaces.cpp
+
+namespace N1 {
+ typedef int t1;
+}
+
+namespace N1 {
+ typedef int t2;
+}
+
+namespace N2 {
+ typedef float t1;
+}
Added: cfe/trunk/test/PCH/namespaces.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/namespaces.cpp?rev=97061&view=auto
==============================================================================
--- cfe/trunk/test/PCH/namespaces.cpp (added)
+++ cfe/trunk/test/PCH/namespaces.cpp Wed Feb 24 15:52:55 2010
@@ -0,0 +1,14 @@
+// Test this without pch.
+// RUN: %clang_cc1 -x c++ -include %S/Inputs/namespaces.h -fsyntax-only %s
+
+// Test with pch.
+// RUN: %clang_cc1 -x c++ -emit-pch -o %t %S/Inputs/namespaces.h
+// RUN: %clang_cc1 -x c++ -include-pch %t -fsyntax-only %s
+
+int int_val;
+N1::t1 *ip1 = &int_val;
+N1::t2 *ip2 = &int_val;
+
+float float_val;
+namespace N2 { }
+N2::t1 *fp1 = &float_val;
More information about the cfe-commits
mailing list