diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-17 01:19:01 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-17 01:19:01 +0000 |
commit | a7fd07f3fcf8a439ea889aff149f8739c88cdf3b (patch) | |
tree | ca1b61381c38e6742f9ec344b3c69376ff1214f4 /clang/test/CodeGenCXX/linetable-virtual-variadic.cpp | |
parent | 170c26d75eb1fb0e8c3c0ae7107ab971bc61e64b (diff) | |
download | bcm5719-llvm-a7fd07f3fcf8a439ea889aff149f8739c88cdf3b.tar.gz bcm5719-llvm-a7fd07f3fcf8a439ea889aff149f8739c88cdf3b.zip |
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.
llvm-svn: 232450
Diffstat (limited to 'clang/test/CodeGenCXX/linetable-virtual-variadic.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/linetable-virtual-variadic.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp b/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp new file mode 100644 index 00000000000..0838dd586a7 --- /dev/null +++ b/clang/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]]) |