summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-03-01 23:49:17 +0000
committerJohn McCall <rjmccall@apple.com>2010-03-01 23:49:17 +0000
commitbd8d9bd39c2df594c4104c117b3b8fea555e8b2c (patch)
tree630f4b126a2e96a11dc36da35ebc14b0312c505d /clang/test/CodeGenCXX/mangle.cpp
parentac8b9246f6b318d77677e96bdf9225ba1dfcaf45 (diff)
downloadbcm5719-llvm-bd8d9bd39c2df594c4104c117b3b8fea555e8b2c.tar.gz
bcm5719-llvm-bd8d9bd39c2df594c4104c117b3b8fea555e8b2c.zip
Split out types that are non-canonical unless dependent as their own
category. Use this in a few places to eliminate unnecessary TST cases and do some future-proofing. Provide terrible manglings for typeof. Mangle decltype with some hope of accuracy. Our manglings for some of the cases covered in the testcase are different from gcc's, which I've raised as an issue with the ABI list. llvm-svn: 97523
Diffstat (limited to 'clang/test/CodeGenCXX/mangle.cpp')
-rw-r--r--clang/test/CodeGenCXX/mangle.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp
index d00579155c2..e18ca03d1be 100644
--- a/clang/test/CodeGenCXX/mangle.cpp
+++ b/clang/test/CodeGenCXX/mangle.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -fblocks | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -fblocks -std=c++0x | FileCheck %s
struct X { };
struct Y { };
@@ -376,3 +376,41 @@ namespace test1 {
// CHECK: define internal void @_Z27functionWithInternalLinkagev()
static void functionWithInternalLinkage() { }
void g() { functionWithInternalLinkage(); }
+
+namespace test2 {
+ template <class T> decltype(((T*) 0)->member) read_member(T& obj) {
+ return obj.member;
+ }
+
+ struct A { int member; } obj;
+ int test() {
+ return read_member(obj);
+ }
+
+ // CHECK: define linkonce_odr i32 @_ZN5test211read_memberINS_1AEEEDtptcvPT_Li0E6memberERS2_(
+}
+
+namespace test3 {
+ struct AmbiguousBase { int ab; };
+ struct Path1 : AmbiguousBase { float p; };
+ struct Path2 : AmbiguousBase { double p; };
+ struct Derived : Path1, Path2 { };
+
+ //template <class T> decltype(((T*) 0)->Path1::ab) get_ab_1(T &ref) { return ref.Path1::ab; }
+ //template <class T> decltype(((T*) 0)->Path2::ab) get_ab_2(T &ref) { return ref.Path2::ab; }
+
+ // define linkonce_odr float @_ZN5test37get_p_1INS_7DerivedEEEDtptcvPT_Li0E5Path11pERS2_(
+ template <class T> decltype(((T*) 0)->Path1::p) get_p_1(T &ref) { return ref.Path1::p; }
+
+ // define linkonce_odr double @_ZN5test37get_p_1INS_7DerivedEEEDtptcvPT_Li0E5Path21pERS2_(
+ template <class T> decltype(((T*) 0)->Path2::p) get_p_2(T &ref) { return ref.Path2::p; }
+
+ Derived obj;
+ void test() {
+ // FIXME: uncomment these when we support diamonds competently
+ //get_ab_1(obj);
+ //get_ab_2(obj);
+ get_p_1(obj);
+ get_p_2(obj);
+ }
+}
OpenPOWER on IntegriCloud