[cfe-commits] r78100 - /cfe/trunk/test/CodeGenCXX/virt.cpp

Mike Stump mrs at apple.com
Tue Aug 4 13:37:34 PDT 2009


Author: mrs
Date: Tue Aug  4 15:37:29 2009
New Revision: 78100

URL: http://llvm.org/viewvc/llvm-project?rev=78100&view=rev
Log:
Test cases for some recent work.

Modified:
    cfe/trunk/test/CodeGenCXX/virt.cpp

Modified: cfe/trunk/test/CodeGenCXX/virt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virt.cpp?rev=78100&r1=78099&r2=78100&view=diff

==============================================================================
--- cfe/trunk/test/CodeGenCXX/virt.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/virt.cpp Tue Aug  4 15:37:29 2009
@@ -1,8 +1,30 @@
-// RUN: clang-cc %s -emit-llvm -o - -std=c++0x
+// RUN: clang-cc -triple x86_64-apple-darwin -frtti=0 -std=c++0x -S %s -o %t-64.s &&
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s &&
+// RUN: clang-cc -triple i386-apple-darwin -frtti=0 -std=c++0x -S %s -o %t-32.s &&
+// RUN: FileCheck -check-prefix LP32 -input-file=%t-32.s %s &&
+// RUN: true
 
 class A {
 public:
-  virtual void foo();
-};
+  virtual void foo1();
+  virtual void foo2();
+  A() { }
+} *a;
 
 static_assert (sizeof (A) == (sizeof(void *)), "vtable pointer layout");
+
+int main() {
+  A a;
+}
+
+// CHECK-LP64: __ZTV1A:
+// CHECK-LP64: .space 8
+// CHECK-LP64: .space 8
+// CHECK-LP64: .quad __ZN1A4foo1Ev
+// CHECK-LP64: .quad __ZN1A4foo2Ev
+
+// CHECK-LP32: __ZTV1A:
+// CHECK-LP32: .space 4
+// CHECK-LP32: .space 4
+// CHECK-LP32: .long __ZN1A4foo1Ev
+// CHECK-LP32: .long __ZN1A4foo2Ev





More information about the cfe-commits mailing list