From: Rafael Espindola Date: Thu, 8 Mar 2012 15:07:42 +0000 (+0000) Subject: Also test pr12104 with pch. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4fae2d9357a35acfb2c234c2b4ea69f63df71042;p=clang Also test pr12104 with pch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152317 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/pr12104.cpp b/test/CodeGenCXX/pr12104.cpp index d126108073..a62f04b668 100644 --- a/test/CodeGenCXX/pr12104.cpp +++ b/test/CodeGenCXX/pr12104.cpp @@ -1,14 +1,7 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -include %S/pr12104.h %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -x c++ -emit-pch -o %t %S/pr12104.h +// RUN: %clang_cc1 -include-pch %t %s -emit-llvm -o - | FileCheck %s -template struct Patch { - static const unsigned int no_neighbor = 1; -}; -template -const unsigned int Patch::no_neighbor; -void f(const unsigned int); -void g() { - f(Patch<1>::no_neighbor); -} template struct Patch<1>; // CHECK: _ZN5PatchILi1EE11no_neighborE diff --git a/test/CodeGenCXX/pr12104.h b/test/CodeGenCXX/pr12104.h new file mode 100644 index 0000000000..f3e9363fe1 --- /dev/null +++ b/test/CodeGenCXX/pr12104.h @@ -0,0 +1,9 @@ +template struct Patch { + static const unsigned int no_neighbor = 1; +}; +template +const unsigned int Patch::no_neighbor; +void f(const unsigned int); +void g() { + f(Patch<1>::no_neighbor); +}