]> granicus.if.org Git - clang/commitdiff
Make bots happy.
authorMike Stump <mrs@apple.com>
Mon, 16 Nov 2009 19:34:15 +0000 (19:34 +0000)
committerMike Stump <mrs@apple.com>
Mon, 16 Nov 2009 19:34:15 +0000 (19:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88941 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/rtti.cpp
test/CodeGenCXX/typeinfo [new file with mode: 0644]

index 94a8bf66613bcbb26615d8d64896d9da82fa8889..49dcbe3f77e85a8f791973d2b1801960a848ff0f 100644 (file)
@@ -1,12 +1,10 @@
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t.s
+// RUN: clang-cc -I%S -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t.s
 // RUN: FileCheck --input-file=%t.s %s
 
-// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t.ll
+// RUN: clang-cc -I%S -triple x86_64-apple-darwin -std=c++0x -emit-llvm %s -o %t.ll
 // RUN: FileCheck -check-prefix LL --input-file=%t.ll %s
 
 #include <typeinfo>
-// FIXME: The above doesn't work in some environments.  What's the best way to fix this?
-// XFAIL: *
 
 class test1_B1 {
   virtual void foo() { }
@@ -114,9 +112,9 @@ void test2_2(test1_D *dp) {
 // CHECK-LL-NEXT:  %vtable = load %"class.std::type_info"*** %0
 // CHECK-LL-NEXT:  %1 = getelementptr inbounds %"class.std::type_info"** %vtable, i64 -1
 // CHECK-LL-NEXT:  %2 = load %"class.std::type_info"** %1
-// CHECK-LL-NEXT:  %call = call zeroext i1 @_ZNK3std9type_infoeqERKS0_(%"class.std::type_info"* %2, %"class.std::type_info"* bitcast (%1* @_ZTI7test1_D to %"class.std::type_info"*))
+// CHECK-LL-NEXT:  %call = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* %2, %"class.std::type_info"* bitcast (%1* @_ZTI7test1_D to %"class.std::type_info"*))
 
-// CHECK-LL:       %call2 = call zeroext i1 @_ZNK3std9type_infoeqERKS0_(%"class.std::type_info"* bitcast (%0* @_ZTI2NP to %"class.std::type_info"*), %"class.std::type_info"* bitcast (%1* @_ZTI7test1_D to %"class.std::type_info"*))
+// CHECK-LL:       %call2 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* bitcast (%0* @_ZTI2NP to %"class.std::type_info"*), %"class.std::type_info"* bitcast (%1* @_ZTI7test1_D to %"class.std::type_info"*))
 
 // CHECK-LL:       %3 = bitcast %class.test1_B7* %tmp5 to %"class.std::type_info"***
 // CHECK-LL-NEXT:  %4 = icmp ne %"class.std::type_info"*** %3, null
@@ -128,4 +126,4 @@ void test2_2(test1_D *dp) {
 // CHECK-LL-NEXT:  %vtable6 = load %"class.std::type_info"*** %3
 // CHECK-LL-NEXT:  %7 = getelementptr inbounds %"class.std::type_info"** %vtable6, i64 -1
 // CHECK-LL-NEXT:  %8 = load %"class.std::type_info"** %7
-// CHECK-LL-NEXT:  %call7 = call zeroext i1 @_ZNK3std9type_infoeqERKS0_(%"class.std::type_info"* %8, %"class.std::type_info"* bitcast (%1* @_ZTI7test1_D to %"class.std::type_info"*))
+// CHECK-LL-NEXT:  %call7 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* %8, %"class.std::type_info"* bitcast (%1* @_ZTI7test1_D to %"class.std::type_info"*))
diff --git a/test/CodeGenCXX/typeinfo b/test/CodeGenCXX/typeinfo
new file mode 100644 (file)
index 0000000..d315529
--- /dev/null
@@ -0,0 +1,15 @@
+namespace std {
+  class type_info {
+    virtual ~type_info();
+    const char* name() const { return __name; }
+    bool operator==(const type_info& __arg) const {
+     return __name == __arg.__name;
+    }
+
+    bool operator!=(const type_info& __arg) const {
+      return !operator==(__arg);
+    }
+  protected:
+    const char *__name;
+  };
+}