r232450 - CodeGenCXX: Test that linetables work with variadic virtual thunks

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Mar 16 18:19:01 PDT 2015


Author: dexonsmith
Date: Mon Mar 16 20:19:01 2015
New Revision: 232450

URL: http://llvm.org/viewvc/llvm-project?rev=232450&view=rev
Log:
CodeGenCXX: Test that linetables work with variadic virtual thunks

Add a frontend test for PR22929, which was fixed by LLVM r232449.
Besides the crash test, check that the `!dbg` attachment is sane since
its presence was the trigger.

Added:
    cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp

Added: cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp?rev=232450&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/linetable-virtual-variadic.cpp Mon Mar 16 20:19:01 2015
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -gline-tables-only %s -o - | FileCheck %s
+// Crasher for PR22929.
+class Base {
+  virtual void VariadicFunction(...);
+};
+
+class Derived : public virtual Base {
+  virtual void VariadicFunction(...);
+};
+
+void Derived::VariadicFunction(...) { }
+
+// CHECK-LABEL: define void @_ZN7Derived16VariadicFunctionEz(
+// CHECK: ret void, !dbg ![[LOC:[0-9]+]]
+// CHECK-LABEL: define void @_ZT{{.+}}N7Derived16VariadicFunctionEz(
+// CHECK: ret void, !dbg ![[LOC:[0-9]+]]
+//
+// CHECK: !llvm.dbg.cu = !{![[CU:[0-9]+]]}
+//
+// CHECK: ![[CU]] = !MDCompileUnit({{.*}} subprograms: ![[SPs:[0-9]+]]
+// CHECK: ![[SPs]] = !{![[SP:[0-9]+]]}
+// CHECK: ![[SP]] = !MDSubprogram(name: "VariadicFunction",{{.*}} function: {{[^:]+}} @_ZN7Derived16VariadicFunctionEz
+// CHECK: ![[LOC]] = !MDLocation({{.*}}scope: ![[SP]])





More information about the cfe-commits mailing list