From d0f25b705d32957c59d324429a573ebf40a15706 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 17 Mar 2015 01:19:01 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232450 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../CodeGenCXX/linetable-virtual-variadic.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/CodeGenCXX/linetable-virtual-variadic.cpp diff --git a/test/CodeGenCXX/linetable-virtual-variadic.cpp b/test/CodeGenCXX/linetable-virtual-variadic.cpp new file mode 100644 index 0000000000..0838dd586a --- /dev/null +++ b/test/CodeGenCXX/linetable-virtual-variadic.cpp @@ -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]]) -- 2.40.0