diff options
| author | Adrian Prantl <aprantl@apple.com> | 2015-02-03 18:40:42 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2015-02-03 18:40:42 +0000 |
| commit | 39428e74a04d93a6732a850c215f359a122cfff1 (patch) | |
| tree | 237da63566e87603c682e084a7c6c56feb48c730 /clang/test/CodeGenObjCXX | |
| parent | 6693d0839af5ae38d7a09bfada7af7a24611d884 (diff) | |
| download | bcm5719-llvm-39428e74a04d93a6732a850c215f359a122cfff1.tar.gz bcm5719-llvm-39428e74a04d93a6732a850c215f359a122cfff1.zip | |
Merge ArtificialLocation into ApplyDebugLocation and make a clear
distinction between the different use-cases. With the previous default
behavior we would occasionally emit empty debug locations in situations
where they actually were strictly required (= on invoke insns).
We now have a choice between defaulting to an empty location or an
artificial location.
Specifically, this fixes a bug caused by a missing debug location when
emitting C++ EH cleanup blocks from within an artificial function, such as
an ObjC destroy helper function.
rdar://problem/19670595
llvm-svn: 228003
Diffstat (limited to 'clang/test/CodeGenObjCXX')
| -rw-r--r-- | clang/test/CodeGenObjCXX/nested-ehlocation.mm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjCXX/nested-ehlocation.mm b/clang/test/CodeGenObjCXX/nested-ehlocation.mm new file mode 100644 index 00000000000..de3e3597548 --- /dev/null +++ b/clang/test/CodeGenObjCXX/nested-ehlocation.mm @@ -0,0 +1,24 @@ +// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -g -stdlib=libc++ -fblocks -fexceptions -x objective-c++ -o - %s | FileCheck %s + +// Verify that all invoke instructions have a debug location. +// Literally: There are no unwind lines that don't end with ", (!dbg 123)". +// CHECK-NOT: {{to label %.* unwind label [^,]+$}} + +void block(void (^)(void)); +extern void foo(); +struct A { + ~A(void) { foo(); } + void bar() const {} +}; +void baz(void const *const) {} +struct B : A {}; +void test() { + A a; + B b; + block(^(void) { + baz(&b); + block(^() { + a.bar(); + }); + }); +} |

