[cfe-commits] r116836 - in /cfe/trunk/test/PCH: Inputs/chain-cxx1.h Inputs/chain-cxx2.h chain-cxx.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Oct 19 11:06:43 PDT 2010


Author: akirtzidis
Date: Tue Oct 19 13:06:43 2010
New Revision: 116836

URL: http://llvm.org/viewvc/llvm-project?rev=116836&view=rev
Log:
Merge headers into test/PCH/chain-cxx.cpp for convenience.

Removed:
    cfe/trunk/test/PCH/Inputs/chain-cxx1.h
    cfe/trunk/test/PCH/Inputs/chain-cxx2.h
Modified:
    cfe/trunk/test/PCH/chain-cxx.cpp

Removed: cfe/trunk/test/PCH/Inputs/chain-cxx1.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/Inputs/chain-cxx1.h?rev=116835&view=auto
==============================================================================
--- cfe/trunk/test/PCH/Inputs/chain-cxx1.h (original)
+++ cfe/trunk/test/PCH/Inputs/chain-cxx1.h (removed)
@@ -1,19 +0,0 @@
-// Primary header for C++ chained PCH test
-
-void f();
-
-// Name not appearing in dependent
-void pf();
-
-namespace ns {
-  void g();
-
-  void pg();
-}
-
-template <typename T>
-struct S { typedef int G; };
-
-// Partially specialize
-template <typename T>
-struct S<T *> { typedef int H; };

Removed: cfe/trunk/test/PCH/Inputs/chain-cxx2.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/Inputs/chain-cxx2.h?rev=116835&view=auto
==============================================================================
--- cfe/trunk/test/PCH/Inputs/chain-cxx2.h (original)
+++ cfe/trunk/test/PCH/Inputs/chain-cxx2.h (removed)
@@ -1,32 +0,0 @@
-// Dependent header for C++ chained PCH test
-
-// Overload function from primary
-void f(int);
-
-// Add function with different name
-void f2();
-
-// Reopen namespace
-namespace ns {
-  // Overload function from primary
-  void g(int);
-
-  // Add different name
-  void g2();
-}
-
-// Specialize template from primary
-template <>
-struct S<int> { typedef int I; };
-
-// Partially specialize
-template <typename T>
-struct S<T &> { typedef int J; };
-
-// Specialize previous partial specialization
-template <>
-struct S<int *> { typedef int K; };
-
-// Specialize the partial specialization from this file
-template <>
-struct S<int &> { typedef int L; };

Modified: cfe/trunk/test/PCH/chain-cxx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/chain-cxx.cpp?rev=116836&r1=116835&r2=116836&view=diff
==============================================================================
--- cfe/trunk/test/PCH/chain-cxx.cpp (original)
+++ cfe/trunk/test/PCH/chain-cxx.cpp Tue Oct 19 13:06:43 2010
@@ -1,13 +1,77 @@
 // Test C++ chained PCH functionality
 
 // Without PCH
-// RUN: %clang_cc1 -fsyntax-only -verify -include %S/Inputs/chain-cxx1.h -include %S/Inputs/chain-cxx2.h %s
+// RUN: %clang_cc1 -fsyntax-only -verify -include %s -include %s %s
 
 // With PCH
-// RUN: %clang_cc1 -x c++ -emit-pch -o %t1 %S/Inputs/chain-cxx1.h
-// RUN: %clang_cc1 -x c++ -emit-pch -o %t2 %S/Inputs/chain-cxx2.h -include-pch %t1 -chained-pch
+// RUN: %clang_cc1 -x c++-header -emit-pch -o %t1 %s
+// RUN: %clang_cc1 -x c++-header -emit-pch -o %t2 %s -include-pch %t1 -chained-pch
 // RUN: %clang_cc1 -fsyntax-only -verify -include-pch %t2 %s
 
+#ifndef HEADER1
+#define HEADER1
+//===----------------------------------------------------------------------===//
+// Primary header for C++ chained PCH test
+
+void f();
+
+// Name not appearing in dependent
+void pf();
+
+namespace ns {
+  void g();
+
+  void pg();
+}
+
+template <typename T>
+struct S { typedef int G; };
+
+// Partially specialize
+template <typename T>
+struct S<T *> { typedef int H; };
+
+//===----------------------------------------------------------------------===//
+#elif not defined(HEADER2)
+#define HEADER2
+//===----------------------------------------------------------------------===//
+// Dependent header for C++ chained PCH test
+
+// Overload function from primary
+void f(int);
+
+// Add function with different name
+void f2();
+
+// Reopen namespace
+namespace ns {
+  // Overload function from primary
+  void g(int);
+
+  // Add different name
+  void g2();
+}
+
+// Specialize template from primary
+template <>
+struct S<int> { typedef int I; };
+
+// Partially specialize
+template <typename T>
+struct S<T &> { typedef int J; };
+
+// Specialize previous partial specialization
+template <>
+struct S<int *> { typedef int K; };
+
+// Specialize the partial specialization from this file
+template <>
+struct S<int &> { typedef int L; };
+
+//===----------------------------------------------------------------------===//
+#else
+//===----------------------------------------------------------------------===//
+
 void test() {
   f();
   f(1);
@@ -26,3 +90,6 @@
   typedef S<int *>::K T5;
   typedef S<int &>::L T6;
 }
+
+//===----------------------------------------------------------------------===//
+#endif





More information about the cfe-commits mailing list