summaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/main.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-02 19:26:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-02 19:26:05 +0000
commit14f1b3e8826ce43b978db93a62d1166055db5394 (patch)
tree0a00ad8d3498783fe0193f3b656bca17c4c8697d /packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/main.cpp
parent4ee8c119c71a06dcad1e0fecc8c675e480e59337 (diff)
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/main.cpp')
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/main.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/main.cpp b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/main.cpp
new file mode 100644
index 0000000000000..2f61152e39853
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/main.cpp
@@ -0,0 +1,22 @@
+struct Bar {
+ int c;
+ int d;
+};
+
+struct Foo {
+ int a;
+ struct Bar &b;
+};
+
+struct Foo *GetAFoo() {
+ static struct Foo f = { 0, *((Bar*)0) };
+ return &f;
+}
+
+int GetSum(struct Foo *f) {
+ return f->a + f->b.d;
+}
+
+int main() {
+ return GetSum(GetAFoo());
+}