From: Eric Christopher Date: Sat, 20 Aug 2011 00:17:18 +0000 (+0000) Subject: Migrate, FileCheckize and update: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aeac10e7b074d87522ccc5fad919417092971c57;p=clang Migrate, FileCheckize and update: 2003-11-02-WeakLinkage.cpp 2003-11-18-PtrMemConstantInitializer.cpp 2003-11-25-ReturningOpaqueByValue.cpp 2003-11-27-MultipleInheritanceThunk.cpp 2003-11-29-DuplicatedCleanupTest.cpp 2003-12-08-ArrayOfPtrToMemberFunc.cpp 2004-01-11-DynamicInitializedConstant.cpp from llvm/test/FrontendC++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138162 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/2003-11-02-WeakLinkage.cpp b/test/CodeGenCXX/2003-11-02-WeakLinkage.cpp new file mode 100644 index 0000000000..02f9fc6e91 --- /dev/null +++ b/test/CodeGenCXX/2003-11-02-WeakLinkage.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// The template should compile to linkonce linkage, not weak linkage. + +// CHECK-NOT: weak +template +void thefunc(); + +template +inline void thefunc() {} + +void test() { + thefunc(); +} diff --git a/test/CodeGenCXX/2003-11-18-PtrMemConstantInitializer.cpp b/test/CodeGenCXX/2003-11-18-PtrMemConstantInitializer.cpp new file mode 100644 index 0000000000..9cecf48611 --- /dev/null +++ b/test/CodeGenCXX/2003-11-18-PtrMemConstantInitializer.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - + +struct Gfx { + void opMoveSetShowText(); +}; + +struct Operator { + void (Gfx::*func)(); +}; + +Operator opTab[] = { + {&Gfx::opMoveSetShowText}, +}; diff --git a/test/CodeGenCXX/2003-11-25-ReturningOpaqueByValue.cpp b/test/CodeGenCXX/2003-11-25-ReturningOpaqueByValue.cpp new file mode 100644 index 0000000000..1a043dbc66 --- /dev/null +++ b/test/CodeGenCXX/2003-11-25-ReturningOpaqueByValue.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - + +#include +std::vector my_method (); + +int +main () +{ + my_method (); + return 0; +} diff --git a/test/CodeGenCXX/2003-11-27-MultipleInheritanceThunk.cpp b/test/CodeGenCXX/2003-11-27-MultipleInheritanceThunk.cpp new file mode 100644 index 0000000000..3e53397327 --- /dev/null +++ b/test/CodeGenCXX/2003-11-27-MultipleInheritanceThunk.cpp @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - + + +struct CallSite { + int X; + + CallSite(const CallSite &CS); +}; + +struct AliasAnalysis { + int TD; + + virtual int getModRefInfo(CallSite CS); +}; + + +struct Pass { + int X; + virtual int foo(); +}; + +struct AliasAnalysisCounter : public Pass, public AliasAnalysis { + int getModRefInfo(CallSite CS) { + return 0; + } +}; + +AliasAnalysisCounter AAC; diff --git a/test/CodeGenCXX/2003-11-29-DuplicatedCleanupTest.cpp b/test/CodeGenCXX/2003-11-29-DuplicatedCleanupTest.cpp new file mode 100644 index 0000000000..45325bc65c --- /dev/null +++ b/test/CodeGenCXX/2003-11-29-DuplicatedCleanupTest.cpp @@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - + + +void doesntThrow() throw(); +struct F { + ~F() { doesntThrow(); } +}; + +void atest() { + F A; +lab: + F B; + goto lab; +} + +void test(int val) { +label: { + F A; + F B; + if (val == 0) goto label; + if (val == 1) goto label; +} +} + +void test3(int val) { +label: { + F A; + F B; + if (val == 0) { doesntThrow(); goto label; } + if (val == 1) { doesntThrow(); goto label; } +} +} + +void test4(int val) { +label: { + F A; + F B; + if (val == 0) { F C; goto label; } + if (val == 1) { F D; goto label; } +} +} diff --git a/test/CodeGenCXX/2003-12-08-ArrayOfPtrToMemberFunc.cpp b/test/CodeGenCXX/2003-12-08-ArrayOfPtrToMemberFunc.cpp new file mode 100644 index 0000000000..38de271b61 --- /dev/null +++ b/test/CodeGenCXX/2003-12-08-ArrayOfPtrToMemberFunc.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - + +struct Evil { + void fun (); +}; +int foo(); +typedef void (Evil::*memfunptr) (); +static memfunptr jumpTable[] = { &Evil::fun }; + +void Evil::fun() { + (this->*jumpTable[foo()]) (); +} diff --git a/test/CodeGenCXX/2004-01-11-DynamicInitializedConstant.cpp b/test/CodeGenCXX/2004-01-11-DynamicInitializedConstant.cpp new file mode 100644 index 0000000000..0c9333fb6d --- /dev/null +++ b/test/CodeGenCXX/2004-01-11-DynamicInitializedConstant.cpp @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s + +// CHECK-NOT: constant +extern int X; +const int Y = X; +const int* foo() { return &Y; }