summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-08-20 00:09:39 +0000
committerEric Christopher <echristo@apple.com>2011-08-20 00:09:39 +0000
commit6672b33511792e0dc9bf5654513a423b4fe3fa54 (patch)
treecdf39e453331b00fa56ec8e1b43d3ac97fe4b67d /clang
parent74cfab0fbef4215fe349d43b733ce3bd8ce5755f (diff)
downloadbcm5719-llvm-6672b33511792e0dc9bf5654513a423b4fe3fa54.tar.gz
bcm5719-llvm-6672b33511792e0dc9bf5654513a423b4fe3fa54.zip
Migrate, FileCheckize and update:
2004-03-08-ReinterpretCastCopy.cpp 2004-03-09-UnmangledBuiltinMethods.cpp 2004-03-15-CleanupsAndGotos.cpp 2004-06-08-LateTemplateInstantiation.cpp 2004-09-27-CompilerCrash.cpp 2004-09-27-DidntEmitTemplate.cpp 2004-11-27-ExceptionCleanupAssertion.cpp 2004-11-27-FriendDefaultArgCrash.cpp 2005-01-03-StaticInitializers.cpp from llvm/test/FrontendC++. llvm-svn: 138157
Diffstat (limited to 'clang')
-rw-r--r--clang/test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp21
-rw-r--r--clang/test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp8
-rw-r--r--clang/test/CodeGenCXX/2004-03-15-CleanupsAndGotos.cpp14
-rw-r--r--clang/test/CodeGenCXX/2004-06-08-LateTemplateInstantiation.cpp18
-rw-r--r--clang/test/CodeGenCXX/2004-09-27-CompilerCrash.cpp13
-rw-r--r--clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp22
-rw-r--r--clang/test/CodeGenCXX/2004-11-27-ExceptionCleanupAssertion.cpp14
-rw-r--r--clang/test/CodeGenCXX/2004-11-27-FriendDefaultArgCrash.cpp9
-rw-r--r--clang/test/CodeGenCXX/2005-01-03-StaticInitializers.cpp8
9 files changed, 127 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp b/clang/test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp
new file mode 100644
index 00000000000..a6e2e30dd59
--- /dev/null
+++ b/clang/test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -emit-llvm %s -o -
+
+struct A {
+ virtual void Method() = 0;
+};
+
+struct B : public A {
+ virtual void Method() { }
+};
+
+typedef void (A::*fn_type_a)(void);
+typedef void (B::*fn_type_b)(void);
+
+int main(int argc, char **argv)
+{
+ fn_type_a f = reinterpret_cast<fn_type_a>(&B::Method);
+ fn_type_b g = reinterpret_cast<fn_type_b>(f);
+ B b;
+ (b.*g)();
+ return 0;
+}
diff --git a/clang/test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp b/clang/test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp
new file mode 100644
index 00000000000..5d8c8b004b7
--- /dev/null
+++ b/clang/test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+
+// CHECK: _ZN11AccessFlags6strlenEv
+struct AccessFlags {
+ void strlen();
+};
+
+void AccessFlags::strlen() { }
diff --git a/clang/test/CodeGenCXX/2004-03-15-CleanupsAndGotos.cpp b/clang/test/CodeGenCXX/2004-03-15-CleanupsAndGotos.cpp
new file mode 100644
index 00000000000..01350c00b9b
--- /dev/null
+++ b/clang/test/CodeGenCXX/2004-03-15-CleanupsAndGotos.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm %s -o -
+
+// Testcase from Bug 291
+
+struct X {
+ ~X();
+};
+
+void foo() {
+ X v;
+
+TryAgain:
+ goto TryAgain;
+}
diff --git a/clang/test/CodeGenCXX/2004-06-08-LateTemplateInstantiation.cpp b/clang/test/CodeGenCXX/2004-06-08-LateTemplateInstantiation.cpp
new file mode 100644
index 00000000000..97254c18a51
--- /dev/null
+++ b/clang/test/CodeGenCXX/2004-06-08-LateTemplateInstantiation.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm %s -o -
+
+
+template<typename Ty>
+struct normal_iterator {
+ int FIELD;
+};
+
+void foo(normal_iterator<int>);
+normal_iterator<int> baz();
+
+void bar() {
+ foo(baz());
+}
+
+void *bar2() {
+ return (void*)foo;
+}
diff --git a/clang/test/CodeGenCXX/2004-09-27-CompilerCrash.cpp b/clang/test/CodeGenCXX/2004-09-27-CompilerCrash.cpp
new file mode 100644
index 00000000000..5e5af4ab602
--- /dev/null
+++ b/clang/test/CodeGenCXX/2004-09-27-CompilerCrash.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -emit-llvm %s -o -
+
+struct Pass {} ;
+template<typename PassName>
+Pass *callDefaultCtor() { return new PassName(); }
+
+void foo(Pass *(*C)());
+
+#include <string>
+
+bool foo(std::string &X) {
+ return X.empty();
+}
diff --git a/clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp b/clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp
new file mode 100644
index 00000000000..618894fd724
--- /dev/null
+++ b/clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+
+// This is a testcase for LLVM PR445, which was a problem where the
+// instantiation of callDefaultCtor was not being emitted correctly.
+
+// CHECK-NOT: declare{{.*}}callDefaultCtor
+struct Pass {};
+
+template<typename PassName>
+Pass *callDefaultCtor() { return new Pass(); }
+
+void foo(Pass *(*C)());
+
+struct basic_string {
+ bool empty() const { return true; }
+};
+
+
+bool foo2(basic_string &X) {
+ return X.empty();
+}
+void baz() { foo(callDefaultCtor<Pass>); }
diff --git a/clang/test/CodeGenCXX/2004-11-27-ExceptionCleanupAssertion.cpp b/clang/test/CodeGenCXX/2004-11-27-ExceptionCleanupAssertion.cpp
new file mode 100644
index 00000000000..ebcce7796e7
--- /dev/null
+++ b/clang/test/CodeGenCXX/2004-11-27-ExceptionCleanupAssertion.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 %s -emit-llvm -o /dev/null
+
+// This is PR421
+
+struct Strongbad {
+ Strongbad(const char *str );
+ ~Strongbad();
+ operator const char *() const;
+};
+
+void TheCheat () {
+ Strongbad foo(0);
+ Strongbad dirs[] = { Strongbad(0) + 1};
+}
diff --git a/clang/test/CodeGenCXX/2004-11-27-FriendDefaultArgCrash.cpp b/clang/test/CodeGenCXX/2004-11-27-FriendDefaultArgCrash.cpp
new file mode 100644
index 00000000000..3bfecd54b78
--- /dev/null
+++ b/clang/test/CodeGenCXX/2004-11-27-FriendDefaultArgCrash.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -emit-llvm %s -o /dev/null
+
+// PR447
+
+namespace nm {
+ struct str {
+ friend int foo(int arg = 0);
+ };
+}
diff --git a/clang/test/CodeGenCXX/2005-01-03-StaticInitializers.cpp b/clang/test/CodeGenCXX/2005-01-03-StaticInitializers.cpp
new file mode 100644
index 00000000000..875c412c6b4
--- /dev/null
+++ b/clang/test/CodeGenCXX/2005-01-03-StaticInitializers.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+
+struct S {
+ int A[2];
+};
+
+// CHECK-NOT: llvm.global_ctor
+int XX = (int)(long)&(((struct S*)0)->A[1]);
OpenPOWER on IntegriCloud