<div dir="ltr">It's too bad it doesn't show the command output from the passed runs :-/ <div><br></div><div>Failure: <a href="http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/40578/testReport/debuginfo-tests/debuginfo-tests/vla_c/">http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/40578/testReport/debuginfo-tests/debuginfo-tests/vla_c/</a></div><div>Pass: <a href="http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/40578/testReport/debuginfo-tests/debuginfo-tests/vla_c_2/">http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/40578/testReport/debuginfo-tests/debuginfo-tests/vla_c_2/</a></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 16, 2017 at 3:52 PM Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Alternatively, perhaps the other tests all use a single clang driver invocation with the clang driver choosing a temporary object file and these two manually specify a name for the .o file.<div><br></div><div></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div>-- adrian</div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><br><div><br><blockquote type="cite"><div>On Nov 16, 2017, at 3:50 PM, Adrian Prantl via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="m_6477781719629286957Apple-interchange-newline"><div><div style="word-wrap:break-word;line-break:after-white-space">I think this makes sense: Last time they failed because they were the only ones that needed an SDKROOT, and this time they failed because they are the only ones that take longer to compile (because the #import some huge system headers). All other tests are so short that they compile instantaneously. These two include system frameworks so they take longer to compile and thus are scheduled to run twice at the same time.<br><div><br></div><div>-- adrian</div><div><br><blockquote type="cite"><div>On Nov 16, 2017, at 3:47 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div><br class="m_6477781719629286957Apple-interchange-newline"><div><div dir="ltr">Are you sure that's actually the problem? Because it's mighty suspicious that it's the exact same two tests that failed with the previous version of the patch.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 16, 2017 at 3:42 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">No, because it won't fix the issue. All debuginfo-tests tests are running twice, and whichever test happens to be scheduled to execute simultaneously will fail, but it's nothing special about these two tests, they just compile slow enough for the problem to manifest.<div><br></div><div></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div>-- adrian</div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><br><div><br><blockquote type="cite"><div>On Nov 16, 2017, at 3:37 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div><br class="m_6477781719629286957m_-8058737202827010305Apple-interchange-newline"><div><div dir="ltr">Can we disable these two tests for now until we can look into this? I'd like to fix it, but this isn't something that I have the ability to diagnose on my end and I'm going to be blocked again if we end up having to revert. :-/</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 16, 2017 at 3:34 PM Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">We can try a clobber. Another possibility is that in an effort to make it so you can run it using both workflows, it now ends up running it twice. Once the old way (by descending into it from the clang tree) and once the new way (.<div><br></div><div>Does this not reproduce for you locally when running ninja check-clang?</div><div><br></div><div>I don't think the directory mismatch is a problem. In debuginfo-tests/<a href="http://lit.cfg.py/" target="_blank">lit.cfg.py</a> I explicitly set the output directory to that location. I don't think it should matter that it's Output instead of Output/tests</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 16, 2017 at 3:29 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">It looks like it is actually running the test twice:<div><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;white-space:pre-wrap">FAIL: debuginfo-tests :: foreach.m (34967 of 40843)
</span><a id="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_71547582897881194115456513578254eaf0-7326-4999-85b0-388101f2d404" style="box-sizing:border-box;word-wrap:break-word;color:rgb(51,51,51);font-family:monospace;font-size:13px;white-space:pre-wrap;display:block"></a><span title="Regression test failed" style="box-sizing:border-box;font-family:monospace;font-size:13px;white-space:pre-wrap;color:white;background-color:red"></span></div><div><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;white-space:pre-wrap">...</span></div><div><span style="color:rgb(51,51,51);font-family:monospace;font-size:13px;white-space:pre-wrap">PASS: debuginfo-tests :: foreach.m (34972 of 40843)
</span><div><br></div><div>does that help to narrow it down?</div><div><br><blockquote type="cite"></blockquote></div></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><div><blockquote type="cite"><div>On Nov 16, 2017, at 3:21 PM, Adrian Prantl via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-interchange-newline"></blockquote></div></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><div><blockquote type="cite"><div><div><blockquote type="cite">Debugger output was: imported lldb from: "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/Python" error: vla.c.tmp.out debug map object file '/Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/clang-build/tools/clang/test/debuginfo-tests/Output/vla.c.tmp.o' has changed (actual time is 0x5a0de4bc, debug map time is 0x5a0de4bb) since this executable was linked, file will be ignored<br></blockquote><br>These are different errors than last time. Could it be that there is a directory mismatch? You moved the tests to tests/ but this path is in Output/ instead of Output/tests?<br><br>It looks like it is finding a file from the build before the big rename. But this is just speculation.<br><br>-- adrian<br><br></div></div></blockquote></div></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><div><blockquote type="cite"><div><div><blockquote type="cite">On Nov 16, 2017, at 3:13 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br><br>Uhh, well that's weird. a because I didn't get an email (or maybe it got filtered somehow), and b) because I made the fix that we thought was going to work.<br><br>Can you think of a way to diagnose this?<br><br>(One option is disabling these two tests until we figure it out. It's not ideal but the code churn from repeated reverts and resubmits is pretty unfortunate)<br><br>On Thu, Nov 16, 2017 at 3:01 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>> wrote:<br>Looks like this broke the Darwin bots again:<br><br><a href="http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/40578/" target="_blank">http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/40578/</a><br><br>-- adrian<br><br><br></blockquote></div></div></blockquote></div></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><div><blockquote type="cite"><div><div><blockquote type="cite"><blockquote type="cite">On Nov 16, 2017, at 10:26 AM, Zachary Turner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br><br>Author: zturner<br>Date: Thu Nov 16 10:26:20 2017<br>New Revision: 318435<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=318435&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=318435&view=rev</a><br>Log:<br>Resubmit "Refactor debuginfo-tests"<br><br>This was reverted due to some failures on specific darwin buildbots,<br>the issue being that the new lit configuration was not setting the<br>SDKROOT environment variable. We've tested a fix locally and confirmed<br>that it works, so this patch resubmits everything with the fix<br>applied.<br><br>Added:<br> debuginfo-tests/trunk/CMakeLists.txt<br> debuginfo-tests/trunk/<a href="http://lit.cfg.py/" target="_blank">lit.cfg.py</a><br> debuginfo-tests/trunk/<a href="http://lit.site.cfg.py.in/" target="_blank">lit.site.cfg.py.in</a><br> debuginfo-tests/trunk/tests/<br> debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp<br> debuginfo-tests/trunk/tests/asan-blocks.c<br> debuginfo-tests/trunk/tests/asan.c<br> debuginfo-tests/trunk/tests/block_var.m<br> debuginfo-tests/trunk/tests/blocks.m<br> debuginfo-tests/trunk/tests/ctor.cpp<br> debuginfo-tests/trunk/tests/dbg-arg.c<br> debuginfo-tests/trunk/tests/foreach.m<br> debuginfo-tests/trunk/tests/forward-declare-class.cpp<br> debuginfo-tests/trunk/tests/lit.local.cfg<br> debuginfo-tests/trunk/tests/llgdb.py<br> debuginfo-tests/trunk/tests/nested-struct.cpp<br> debuginfo-tests/trunk/tests/nrvo-string.cpp<br> debuginfo-tests/trunk/tests/safestack.c<br> debuginfo-tests/trunk/tests/sret.cpp<br> debuginfo-tests/trunk/tests/stack-var.c<br> debuginfo-tests/trunk/tests/static-member-2.cpp<br> debuginfo-tests/trunk/tests/static-member.cpp<br> debuginfo-tests/trunk/tests/vla.c<br>Removed:<br> debuginfo-tests/trunk/aggregate-indirect-arg.cpp<br> debuginfo-tests/trunk/asan-blocks.c<br> debuginfo-tests/trunk/asan.c<br> debuginfo-tests/trunk/block_var.m<br> debuginfo-tests/trunk/blocks.m<br> debuginfo-tests/trunk/ctor.cpp<br> debuginfo-tests/trunk/dbg-arg.c<br> debuginfo-tests/trunk/foreach.m<br> debuginfo-tests/trunk/forward-declare-class.cpp<br> debuginfo-tests/trunk/lit.local.cfg<br> debuginfo-tests/trunk/llgdb.py<br> debuginfo-tests/trunk/nested-struct.cpp<br> debuginfo-tests/trunk/nrvo-string.cpp<br> debuginfo-tests/trunk/safestack.c<br> debuginfo-tests/trunk/sret.cpp<br> debuginfo-tests/trunk/stack-var.c<br> debuginfo-tests/trunk/static-member-2.cpp<br> debuginfo-tests/trunk/static-member.cpp<br> debuginfo-tests/trunk/vla.c<br><br>Added: debuginfo-tests/trunk/CMakeLists.txt<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/CMakeLists.txt?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/CMakeLists.txt?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/CMakeLists.txt (added)<br>+++ debuginfo-tests/trunk/CMakeLists.txt Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,36 @@<br>+# Debug Info tests. These tests invoke clang to generate programs with<br>+# various types of debug info, and then run those programs under a debugger<br>+# such as GDB or LLDB to verify the results.<br>+<br>+set(DEBUGINFO_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})<br>+set(DEBUGINFO_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})<br>+<br>+set(DEBUGINFO_TEST_DEPS<br>+ clang<br>+ llvm-config<br>+ FileCheck<br>+ count<br>+ not<br>+ )<br>+<br>+get_target_property(CLANG_SOURCE_DIR clang SOURCE_DIR)<br>+<br>+if (TARGET lld)<br>+ set(DEBUGINFO_TESTS_HAS_LLD 1)<br>+ list(APPEND DEBUGINFO_TEST_DEPS lld)<br>+ get_target_property(LLD_SOURCE_DIR lld SOURCE_DIR)<br>+endif()<br>+<br>+configure_lit_site_cfg(<br>+ ${CMAKE_CURRENT_SOURCE_DIR}/<a href="http://lit.site.cfg.py.in/" target="_blank">lit.site.cfg.py.in</a><br>+ ${CMAKE_CURRENT_BINARY_DIR}/<a href="http://lit.site.cfg.py/" target="_blank">lit.site.cfg.py</a><br>+ MAIN_CONFIG<br>+ ${CMAKE_CURRENT_SOURCE_DIR}/<a href="http://lit.cfg.py/" target="_blank">lit.cfg.py</a><br>+ )<br>+<br>+add_lit_testsuite(check-debuginfo "Running debug info integration tests"<br>+ ${CMAKE_CURRENT_BINARY_DIR}<br>+ DEPENDS ${DEBUGINFO_TEST_DEPS}<br>+ )<br>+<br>+set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")<br>\ No newline at end of file<br><br>Removed: debuginfo-tests/trunk/aggregate-indirect-arg.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/aggregate-indirect-arg.cpp?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/aggregate-indirect-arg.cpp?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/aggregate-indirect-arg.cpp (original)<br>+++ debuginfo-tests/trunk/aggregate-indirect-arg.cpp (removed)<br>@@ -1,32 +0,0 @@<br>-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>-// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br>-// RUN: %test_debuginfo %s %t.out <br>-// Radar 8945514<br>-// DEBUGGER: break 22<br>-// DEBUGGER: r<br>-// DEBUGGER: p v<br>-// CHECK: ${{[0-9]+}} =<br>-// CHECK: Data ={{.*}} 0x0{{(0*)}}<br>-// CHECK: Kind = 2142<br>-<br>-class SVal {<br>-public:<br>- ~SVal() {}<br>- const void* Data;<br>- unsigned Kind;<br>-};<br>-<br>-void bar(SVal &v) {}<br>-class A {<br>-public:<br>- void foo(SVal v) { bar(v); }<br>-};<br>-<br>-int main() {<br>- SVal v;<br>- v.Data = 0;<br>- v.Kind = 2142;<br>- A a;<br>- a.foo(v);<br>- return 0;<br>-}<br><br>Removed: debuginfo-tests/trunk/asan-blocks.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/asan-blocks.c?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/asan-blocks.c?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/asan-blocks.c (original)<br>+++ debuginfo-tests/trunk/asan-blocks.c (removed)<br>@@ -1,41 +0,0 @@<br>-// RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address<br>-// RUN: %test_debuginfo %s %t.out<br>-// FIXME: Remove system-darwin when we build BlocksRuntime everywhere.<br>-// REQUIRES: not_asan, system-darwin<br>-// Zorg configures the ASAN stage2 bots to not build the asan<br>-// compiler-rt. Only run this test on non-asanified configurations.<br>-void b();<br>-struct S {<br>- int a[8];<br>-};<br>-<br>-int f(struct S s, unsigned i) {<br>- // DEBUGGER: break 17<br>- // DEBUGGER: r<br>- // DEBUGGER: p s<br>- // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)<br>- return s.a[i];<br>-}<br>-<br>-int main(int argc, const char **argv) {<br>- struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br>- if (f(s, 4) == 4) {<br>- // DEBUGGER: break 27<br>- // DEBUGGER: c<br>- // DEBUGGER: p s<br>- // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)<br>- b();<br>- }<br>- return 0;<br>-}<br>-<br>-void c() {}<br>-<br>-void b() {<br>- // DEBUGGER: break 40<br>- // DEBUGGER: c<br>- // DEBUGGER: p x<br>- // CHECK: 42<br>- __block int x = 42;<br>- c();<br>-}<br><br>Removed: debuginfo-tests/trunk/asan.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/asan.c?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/asan.c?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/asan.c (original)<br>+++ debuginfo-tests/trunk/asan.c (removed)<br>@@ -1,31 +0,0 @@<br>-// RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address<br>-// RUN: %test_debuginfo %s %t.out<br>-// REQUIRES: not_asan<br>-// Zorg configures the ASAN stage2 bots to not build the asan<br>-// compiler-rt. Only run this test on non-asanified configurations.<br>-//<br>-<br>-struct S {<br>- int a[8];<br>-};<br>-<br>-int f(struct S s, unsigned i) {<br>- // DEBUGGER: break 14<br>- return s.a[i];<br>-}<br>-<br>-int main(int argc, const char **argv) {<br>- struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br>- if (f(s, 4) == 4)<br>- return f(s, 0);<br>- return 0;<br>-}<br>-<br>-// DEBUGGER: r<br>-// DEBUGGER: p s<br>-// CHECK: a =<br>-// DEBUGGER: p s.a[0]<br>-// CHECK: = 0<br>-// DEBUGGER: p s.a[1]<br>-// CHECK: = 1<br>-// DEBUGGER: p s.a[7]<br><br>Removed: debuginfo-tests/trunk/block_var.m<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/block_var.m?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/block_var.m?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/block_var.m (original)<br>+++ debuginfo-tests/trunk/block_var.m (removed)<br>@@ -1,32 +0,0 @@<br>-// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>-// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br>-// RUN: %test_debuginfo %s %t.out <br>-<br>-// REQUIRES: system-darwin<br>-<br>-// DEBUGGER: break 24<br>-// DEBUGGER: r<br>-// DEBUGGER: p result<br>-// CHECK: ${{[0-9]}} = 42<br>-<br>-void doBlock(void (^block)(void))<br>-{<br>- block();<br>-}<br>-<br>-int I(int n)<br>-{<br>- __block int result;<br>- int i = 2;<br>- doBlock(^{<br>- result = n;<br>- });<br>- return result + i; /* Check value of 'result' */<br>-}<br>-<br>-<br>-int main (int argc, const char * argv[]) {<br>- return I(42);<br>-}<br>-<br>-<br><br>Removed: debuginfo-tests/trunk/blocks.m<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/blocks.m?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/blocks.m?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/blocks.m (original)<br>+++ debuginfo-tests/trunk/blocks.m (removed)<br>@@ -1,43 +0,0 @@<br>-// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>-// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br>-// RUN: %test_debuginfo %s %t.out <br>-<br>-// REQUIRES: system-darwin<br>-// Radar 9279956<br>-<br>-// DEBUGGER: break 31<br>-// DEBUGGER: r<br>-// DEBUGGER: p m2<br>-// CHECK: ${{[0-9]}} = 1<br>-// DEBUGGER: p dbTransaction<br>-// CHECK: ${{[0-9]}} = 0<br>-// DEBUGGER: p master<br>-// CHECK: ${{[0-9]}} = 0<br>-<br>-#include <Cocoa/Cocoa.h><br>-<br>-extern void foo(void(^)(void));<br>-<br>-@interface A:NSObject @end<br>-@implementation A<br>-- (void) helper {<br>- int master = 0;<br>- __block int m2 = 0;<br>- __block int dbTransaction = 0;<br>- int (^x)(void) = ^(void) { (void) self; <br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>(void) master; <br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>(void) dbTransaction; <br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>m2++;<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>return m2;<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>};<br>- master = x();<br>-}<br>-@end<br>-<br>-void foo(void(^x)(void)) {}<br>-<br>-int main() {<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>A *a = [A alloc];<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>[a helper];<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>return 0;<br>-}<br><br>Removed: debuginfo-tests/trunk/ctor.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/ctor.cpp?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/ctor.cpp?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/ctor.cpp (original)<br>+++ debuginfo-tests/trunk/ctor.cpp (removed)<br>@@ -1,25 +0,0 @@<br>-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>-// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br>-// RUN: %test_debuginfo %s %t.out <br>-<br>-<br>-// DEBUGGER: break 14<br>-// DEBUGGER: r<br>-// DEBUGGER: p *this<br>-// CHECK-NEXT-NOT: Cannot access memory at address <br>-<br>-class A {<br>-public:<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>A() : zero(0), data(42)<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>{<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>}<br>-private:<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>int zero;<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>int data;<br>-};<br>-<br>-int main() {<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>A a;<br>-<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>return 0;<br>-}<br>-<br><br>Removed: debuginfo-tests/trunk/dbg-arg.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/dbg-arg.c?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/dbg-arg.c?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/dbg-arg.c (original)<br>+++ debuginfo-tests/trunk/dbg-arg.c (removed)<br>@@ -1,46 +0,0 @@<br>-// This test case checks debug info during register moves for an argument.<br>-// RUN: %clang %target_itanium_abi_host_triple -m64 -mllvm -fast-isel=false %s -c -o %t.o -g<br>-// RUN: %clang %target_itanium_abi_host_triple -m64 %t.o -o %t.out<br>-// RUN: %test_debuginfo %s %t.out<br>-//<br>-// DEBUGGER: break 26<br>-// DEBUGGER: r<br>-// DEBUGGER: print mutex<br>-// CHECK: ={{.* 0x[0-9A-Fa-f]+}}<br>-//<br>-// Radar 8412415<br>-<br>-struct _mtx<br>-{<br>- long unsigned int ptr;<br>- int waiters;<br>- struct {<br>- int tag;<br>- int pad;<br>- } mtxi;<br>-};<br>-<br>-<br>-int foobar(struct _mtx *mutex) {<br>- int r = 1;<br>- int l = 0;<br>- int j = 0;<br>- do {<br>- if (mutex->waiters) {<br>- r = 2;<br>- }<br>- j = bar(r, l);<br>- ++l;<br>- } while (l < j);<br>- return r + j;<br>-}<br>-<br>-int bar(int i, int j) {<br>- return i + j;<br>-}<br>-<br>-int main() {<br>- struct _mtx m;<br>- m.waiters = 0;<br>- return foobar(&m);<br>-}<br><br>Removed: debuginfo-tests/trunk/foreach.m<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/foreach.m?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/foreach.m?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/foreach.m (original)<br>+++ debuginfo-tests/trunk/foreach.m (removed)<br>@@ -1,31 +0,0 @@<br>-// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>-// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br>-// RUN: %test_debuginfo %s %t.out <br>-//<br>-// REQUIRES: system-darwin<br>-// Radar 8757124<br>-<br>-// DEBUGGER: break 25<br>-// DEBUGGER: r<br>-// DEBUGGER: po thing<br>-// CHECK: aaa<br>-<br>-#import <Foundation/Foundation.h><br>-<br>-int main (int argc, const char * argv[]) {<br>-<br>- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];<br>- NSArray *things = [NSArray arrayWithObjects:@"one", @"two", @"three" , nil];<br>- for (NSString *thing in things) {<br>- NSLog (@"%@", thing);<br>- }<br>- <br>- things = [NSArray arrayWithObjects:@"aaa", @"bbb", @"ccc" , nil];<br>- for (NSString *thing in things) {<br>- NSLog (@"%@", thing);<br>- }<br>- [pool release];<br>- return 0;<br>-}<br>-<br>-<br><br>Removed: debuginfo-tests/trunk/forward-declare-class.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/forward-declare-class.cpp?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/forward-declare-class.cpp?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/forward-declare-class.cpp (original)<br>+++ debuginfo-tests/trunk/forward-declare-class.cpp (removed)<br>@@ -1,27 +0,0 @@<br>-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>-// RUN: %test_debuginfo %s %t.o<br>-// Radar 9168773<br>-<br>-// DEBUGGER: ptype A<br>-// Work around a gdb bug where it believes that a class is a<br>-// struct if there aren't any methods - even though it's tagged<br>-// as a class.<br>-// CHECK: type = {{struct|class}} A {<br>-// CHECK-NEXT: {{(public:){0,1}}}<br>-// CHECK-NEXT: int MyData;<br>-// CHECK-NEXT: }<br>-class A;<br>-class B {<br>-public:<br>- void foo(const A *p);<br>-};<br>-<br>-B iEntry;<br>-<br>-class A {<br>-public:<br>- int MyData;<br>-};<br>-<br>-A irp;<br>-<br><br>Added: debuginfo-tests/trunk/<a href="http://lit.cfg.py/" target="_blank">lit.cfg.py</a><br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.cfg.py?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.cfg.py?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/<a href="http://lit.cfg.py/" target="_blank">lit.cfg.py</a> (added)<br>+++ debuginfo-tests/trunk/<a href="http://lit.cfg.py/" target="_blank">lit.cfg.py</a> Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,59 @@<br>+# -*- Python -*-<br>+<br>+import os<br>+import platform<br>+import re<br>+import subprocess<br>+import tempfile<br>+<br>+import lit.formats<br>+import lit.util<br>+<br>+from lit.llvm import llvm_config<br>+from lit.llvm.subst import ToolSubst<br>+from lit.llvm.subst import FindTool<br>+<br>+# Configuration file for the 'lit' test runner.<br>+<br>+# name: The name of this test suite.<br>+<a href="http://config.name/" target="_blank">config.name</a> = 'debuginfo-tests'<br>+<br>+# testFormat: The test format to use to interpret tests.<br>+#<br>+# For now we require '&&' between commands, until they get globally killed and<br>+# the test runner updated.<br>+config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)<br>+<br>+# suffixes: A list of file extensions to treat as test files.<br>+config.suffixes = ['.c', '.cpp', '.m']<br>+<br>+# excludes: A list of directories to exclude from the testsuite. The 'Inputs'<br>+# subdirectories contain auxiliary inputs for various tests in their parent<br>+# directories.<br>+config.excludes = ['Inputs']<br>+<br>+# test_source_root: The root path where tests are located.<br>+config.test_source_root = os.path.join(config.debuginfo_tests_src_root, 'tests')<br>+<br>+# test_exec_root: The root path where tests should be run.<br>+config.test_exec_root = config.debuginfo_tests_obj_root<br>+<br>+llvm_config.use_default_substitutions()<br>+<br>+llvm_config.use_clang()<br>+<br>+if config.llvm_use_sanitizer:<br>+ # Propagate path to symbolizer for ASan/MSan.<br>+ llvm_config.with_system_environment(<br>+ ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])<br>+<br>+tool_dirs = [config.llvm_tools_dir]<br>+<br>+tools = [<br>+ ToolSubst('%test_debuginfo', command=os.path.join(<br>+ config.llvm_src_root, 'utils', '<a href="http://test_debuginfo.pl/" target="_blank">test_debuginfo.pl</a>')),<br>+]<br>+<br>+llvm_config.add_tool_substitutions(tools, tool_dirs)<br>+<br>+lit.util.usePlatformSdkOnDarwin(config, lit_config)<br><br>Removed: debuginfo-tests/trunk/lit.local.cfg<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.local.cfg?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.local.cfg?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/lit.local.cfg (original)<br>+++ debuginfo-tests/trunk/lit.local.cfg (removed)<br>@@ -1,3 +0,0 @@<br>-# debuginfo-tests are not expected to pass in a cross-compilation setup.<br>-if 'native' not in config.available_features:<br>- config.unsupported = True<br><br>Added: debuginfo-tests/trunk/<a href="http://lit.site.cfg.py.in/" target="_blank">lit.site.cfg.py.in</a><br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.site.cfg.py.in?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.site.cfg.py.in?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/<a href="http://lit.site.cfg.py.in/" target="_blank">lit.site.cfg.py.in</a> (added)<br>+++ debuginfo-tests/trunk/<a href="http://lit.site.cfg.py.in/" target="_blank">lit.site.cfg.py.in</a> Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,25 @@<br>+@LIT_SITE_CFG_IN_HEADER@<br>+<br>+import lit.util<br>+<br>+config.test_exec_root = "@CMAKE_BINARY_DIR@"<br>+<br>+config.llvm_src_root = "@LLVM_SOURCE_DIR@"<br>+config.llvm_obj_root = "@LLVM_BINARY_DIR@"<br>+config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"<br>+config.llvm_libs_dir = "@LLVM_LIBS_DIR@"<br>+config.llvm_shlib_dir = "@SHLIBDIR@"<br>+config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@"<br>+config.debuginfo_tests_obj_root = "@DEBUGINFO_TESTS_BINARY_DIR@"<br>+config.debuginfo_tests_src_root = "@DEBUGINFO_TESTS_SOURCE_DIR@"<br>+config.has_lld = lit.util.pythonize_bool("@DEBUGINFO_TESTS_HAS_LLD@")<br>+config.host_triple = "@LLVM_HOST_TRIPLE@"<br>+config.target_triple = "@TARGET_TRIPLE@"<br>+config.host_arch = "@HOST_ARCH@"<br>+<br>+config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"<br>+<br>+@LIT_SITE_CFG_IN_FOOTER@<br>+<br>+# Let the main config do the real work.<br>+lit_config.load_config(config, "@DEBUGINFO_TESTS_SOURCE_DIR@/<a href="http://lit.cfg.py/" target="_blank">lit.cfg.py</a>")<br><br>Removed: debuginfo-tests/trunk/llgdb.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/llgdb.py?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/llgdb.py?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/llgdb.py (original)<br>+++ debuginfo-tests/trunk/llgdb.py (removed)<br>@@ -1,157 +0,0 @@<br>-#!/bin/env python<br>-"""<br>-A gdb-compatible frontend for lldb that implements just enough<br>-commands to run the tests in the debuginfo-tests repository with lldb.<br>-"""<br>-<br>-# ----------------------------------------------------------------------<br>-# Auto-detect lldb python module.<br>-import commands, platform, os, sys<br>-try:<br>- # Just try for LLDB in case PYTHONPATH is already correctly setup.<br>- import lldb<br>-except ImportError:<br>- lldb_python_dirs = list()<br>- # lldb is not in the PYTHONPATH, try some defaults for the current platform.<br>- platform_system = platform.system()<br>- if platform_system == 'Darwin':<br>- # On Darwin, try the currently selected Xcode directory<br>- xcode_dir = commands.getoutput("xcode-select --print-path")<br>- if xcode_dir:<br>- lldb_python_dirs.append(os.path.realpath(xcode_dir +<br>-'/../SharedFrameworks/LLDB.framework/Resources/Python'))<br>- lldb_python_dirs.append(xcode_dir +<br>-'/Library/PrivateFrameworks/LLDB.framework/Resources/Python')<br>- lldb_python_dirs.append(<br>-'/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')<br>- success = False<br>- for lldb_python_dir in lldb_python_dirs:<br>- if os.path.exists(lldb_python_dir):<br>- if not (sys.path.__contains__(lldb_python_dir)):<br>- sys.path.append(lldb_python_dir)<br>- try:<br>- import lldb<br>- except ImportError:<br>- pass<br>- else:<br>- print 'imported lldb from: "%s"' % (lldb_python_dir)<br>- success = True<br>- break<br>- if not success:<br>- print "error: couldn't locate the 'lldb' module, please set PYTHONPATH correctly"<br>- sys.exit(1)<br>-# ----------------------------------------------------------------------<br>-<br>-# Command line option handling.<br>-import argparse<br>-parser = argparse.ArgumentParser(description=__doc__)<br>-parser.add_argument('--quiet', '-q', action="store_true", help='ignored')<br>-parser.add_argument('-batch', action="store_true",<br>- help='exit after processing comand line')<br>-parser.add_argument('-n', action="store_true", help='ignore .lldb file')<br>-parser.add_argument('-x', dest='script', type=file, help='execute commands from file')<br>-parser.add_argument("target", help="the program to debug")<br>-args = parser.parse_args()<br>-<br>-<br>-# Create a new debugger instance.<br>-debugger = lldb.SBDebugger.Create()<br>-debugger.SkipLLDBInitFiles(args.n)<br>-<br>-# Don't return from lldb function calls until the process stops.<br>-debugger.SetAsync(False)<br>-<br>-# Create a target from a file and arch.<br>-arch = os.popen("file "+args.target).read().split()[-1]<br>-target = debugger.CreateTargetWithFileAndArch(args.target, arch)<br>-<br>-if not target:<br>- print "Could not create target", args.target<br>- sys.exit(1)<br>-<br>-if not args.script:<br>- print "Interactive mode is not implemented."<br>- sys.exit(1)<br>-<br>-import re<br>-for command in args.script:<br>- # Strip newline and whitespaces and split into words.<br>- cmd = command[:-1].strip().split()<br>- if not cmd:<br>- continue<br>-<br>- print '> %s'% command[:-1]<br>-<br>- try:<br>- if re.match('^r|(run)$', cmd[0]):<br>- error = lldb.SBError()<br>- launchinfo = lldb.SBLaunchInfo([])<br>- launchinfo.SetWorkingDirectory(os.getcwd())<br>- process = target.Launch(launchinfo, error)<br>- print error<br>- if not process or error.fail:<br>- state = process.GetState()<br>- print "State = %d" % state<br>- print """<br>-ERROR: Could not launch process.<br>-NOTE: There are several reasons why this may happen:<br>- * Root needs to run "DevToolsSecurity --enable".<br>- * Older versions of lldb cannot launch more than one process simultaneously.<br>-"""<br>- sys.exit(1)<br>-<br>- elif re.match('^b|(break)$', cmd[0]) and len(cmd) == 2:<br>- if re.match('[0-9]+', cmd[1]):<br>- # b line<br>- mainfile = target.FindFunctions('main')[0].compile_unit.file<br>- print target.BreakpointCreateByLocation(mainfile, int(cmd[1]))<br>- else:<br>- # b file:line<br>- file, line = cmd[1].split(':')<br>- print target.BreakpointCreateByLocation(file, int(line))<br>-<br>- elif re.match('^ptype$', cmd[0]) and len(cmd) == 2:<br>- # GDB's ptype has multiple incarnations depending on its<br>- # argument (global variable, function, type). The definition<br>- # here is for looking up the signature of a function and only<br>- # if that fails it looks for a type with that name.<br>- # Type lookup in LLDB would be "image lookup --type".<br>- for elem in target.FindFunctions(cmd[1]):<br>- print elem.function.type<br>- continue<br>- print target.FindFirstType(cmd[1])<br>-<br>- elif re.match('^po$', cmd[0]) and len(cmd) > 1:<br>- try:<br>- opts = lldb.SBExpressionOptions()<br>- opts.SetFetchDynamicValue(True)<br>- opts.SetCoerceResultToId(True)<br>- print target.EvaluateExpression(' '.join(cmd[1:]), opts)<br>- except:<br>- # FIXME: This is a fallback path for the <a href="http://lab.llvm.org/" target="_blank">lab.llvm.org</a><br>- # buildbot running OS X 10.7; it should be removed.<br>- thread = process.GetThreadAtIndex(0)<br>- frame = thread.GetFrameAtIndex(0)<br>- print frame.EvaluateExpression(' '.join(cmd[1:]))<br>-<br>- elif re.match('^p|(print)$', cmd[0]) and len(cmd) > 1:<br>- thread = process.GetThreadAtIndex(0)<br>- frame = thread.GetFrameAtIndex(0)<br>- print frame.EvaluateExpression(' '.join(cmd[1:]))<br>-<br>- elif re.match('^n|(next)$', cmd[0]):<br>- thread = process.GetThreadAtIndex(0)<br>- thread.StepOver()<br>-<br>- elif re.match('^q|(quit)$', cmd[0]):<br>- sys.exit(0)<br>-<br>- else:<br>- print debugger.HandleCommand(' '.join(cmd))<br>-<br>- except SystemExit:<br>- lldb.SBDebugger_Terminate()<br>- raise<br>- except:<br>- print 'Could not handle the command "%s"' % ' '.join(cmd)<br>-<br><br>Removed: debuginfo-tests/trunk/nested-struct.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/nested-struct.cpp?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/nested-struct.cpp?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/nested-struct.cpp (original)<br>+++ debuginfo-tests/trunk/nested-struct.cpp (removed)<br>@@ -1,21 +0,0 @@<br>-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>-// RUN: %test_debuginfo %s %t.o<br>-// Radar 9440721<br>-// If debug info for my_number() is emitted outside function foo's scope<br>-// then a debugger may not be able to handle it. At least one version of<br>-// gdb crashes in such cases.<br>-<br>-// DEBUGGER: ptype foo<br>-// CHECK: int (void)<br>-<br>-int foo() {<br>- struct Local {<br>- static int my_number() {<br>- return 42;<br>- }<br>- };<br>-<br>- int i = 0;<br>- i = Local::my_number();<br>- return i + 1;<br>-}<br><br>Removed: debuginfo-tests/trunk/nrvo-string.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/nrvo-string.cpp?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/nrvo-string.cpp?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/nrvo-string.cpp (original)<br>+++ debuginfo-tests/trunk/nrvo-string.cpp (removed)<br>@@ -1,27 +0,0 @@<br>-// This ensures that DW_OP_deref is inserted when necessary, such as when NRVO<br>-// of a string object occurs in C++.<br>-//<br>-// RUN: %clangxx -O0 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g<br>-// RUN: %test_debuginfo %s %t.out<br>-// RUN: %clangxx -O1 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g<br>-// RUN: %test_debuginfo %s %t.out<br>-//<br>-// PR34513<br>-<br>-struct string {<br>- string() {}<br>- string(int i) : i(i) {}<br>- ~string() {}<br>- int i = 0;<br>-};<br>-string get_string() {<br>- string unused;<br>- string result = 3;<br>-// DEBUGGER: break 21<br>- return result;<br>-}<br>-int main() { get_string(); }<br>-<br>-// DEBUGGER: r<br>-// DEBUGGER: print result.i<br>-// CHECK: = 3<br><br>Removed: debuginfo-tests/trunk/safestack.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/safestack.c?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/safestack.c?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/safestack.c (original)<br>+++ debuginfo-tests/trunk/safestack.c (removed)<br>@@ -1,51 +0,0 @@<br>-// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=safe-stack<br>-// RUN: %test_debuginfo %s %t.out<br>-// REQUIRES: not_asan<br>-// Zorg configures the ASAN stage2 bots to not build the<br>-// safestack compiler-rt. Only run this test on<br>-// non-asanified configurations.<br>-<br>-struct S {<br>- int a[8];<br>-};<br>-<br>-int f(struct S s, unsigned i);<br>-<br>-int main(int argc, const char **argv) {<br>- struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br>- // DEBUGGER: break 17<br>- f(s, 4);<br>- // DEBUGGER: break 19<br>- return 0;<br>-}<br>-<br>-int f(struct S s, unsigned i) {<br>- // DEBUGGER: break 24<br>- return s.a[i];<br>-}<br>-<br>-// DEBUGGER: r<br>-// DEBUGGER: p s<br>-// CHECK: a =<br>-// DEBUGGER: p s.a[0]<br>-// CHECK: = 0<br>-// DEBUGGER: p s.a[1]<br>-// CHECK: = 1<br>-// DEBUGGER: p s.a[7]<br>-// CHECK: = 7<br>-// DEBUGGER: c<br>-// DEBUGGER: p s<br>-// CHECK: a =<br>-// DEBUGGER: p s.a[0]<br>-// CHECK: = 0<br>-// DEBUGGER: p s.a[1]<br>-// CHECK: = 1<br>-// DEBUGGER: p s.a[7]<br>-// DEBUGGER: c<br>-// DEBUGGER: p s<br>-// CHECK: a =<br>-// DEBUGGER: p s.a[0]<br>-// CHECK: = 0<br>-// DEBUGGER: p s.a[1]<br>-// CHECK: = 1<br>-// DEBUGGER: p s.a[7]<br><br>Removed: debuginfo-tests/trunk/sret.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/sret.cpp?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/sret.cpp?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/sret.cpp (original)<br>+++ debuginfo-tests/trunk/sret.cpp (removed)<br>@@ -1,71 +0,0 @@<br>-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>-// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br>-// RUN: %test_debuginfo %s %t.out <br>-// Radar 8775834<br>-// DEBUGGER: break 62<br>-// DEBUGGER: r<br>-// DEBUGGER: p a<br>-// CHECK: ${{[0-9]+}} =<br>-// LLDB does not print artificial members.<br>-// CHECK: {{(_vptr\$A =)?.*}}m_int = 12<br>-<br>-class A<br>-{<br>-public:<br>- A (int i=0);<br>- A (const A& rhs);<br>- const A&<br>- operator= (const A& rhs);<br>- virtual ~A() {}<br>-<br>- int get_int();<br>-<br>-protected:<br>- int m_int;<br>-};<br>-<br>-A::A (int i) : <br>- m_int(i)<br>-{<br>-}<br>-<br>-A::A (const A& rhs) :<br>- m_int (rhs.m_int)<br>-{<br>-}<br>-<br>-const A &<br>-A::operator =(const A& rhs)<br>-{<br>- m_int = rhs.m_int;<br>- return *this;<br>-}<br>-<br>-int A::get_int()<br>-{<br>- return m_int;<br>-}<br>-<br>-class B<br>-{<br>-public:<br>- B () {}<br>- <br>- A AInstance();<br>-};<br>-<br>-A <br>-B::AInstance()<br>-{<br>- A a(12);<br>- return a;<br>-}<br>-<br>-int main (int argc, char const *argv[])<br>-{<br>- B b;<br>- int return_val = b.AInstance().get_int();<br>- <br>- A a(b.AInstance());<br>- return return_val;<br>-}<br><br>Removed: debuginfo-tests/trunk/stack-var.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/stack-var.c?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/stack-var.c?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/stack-var.c (original)<br>+++ debuginfo-tests/trunk/stack-var.c (removed)<br>@@ -1,18 +0,0 @@<br>-// RUN: %clang %target_itanium_abi_host_triple %s -O -o %t.out -g<br>-// RUN: %test_debuginfo %s %t.out<br>-<br>-void __attribute__((noinline, optnone)) bar(int *test) {}<br>-int main() {<br>- int test;<br>- test = 23;<br>- // DEBUGGER: break 12<br>- // DEBUGGER: r<br>- // DEBUGGER: p test<br>- // CHECK: = 23<br>- bar(&test);<br>- // DEBUGGER: break 17<br>- // DEBUGGER: c<br>- // DEBUGGER: p test<br>- // CHECK: = 23<br>- return test;<br>-}<br><br>Removed: debuginfo-tests/trunk/static-member-2.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/static-member-2.cpp?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/static-member-2.cpp?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/static-member-2.cpp (original)<br>+++ debuginfo-tests/trunk/static-member-2.cpp (removed)<br>@@ -1,39 +0,0 @@<br>-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c<br>-// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out<br>-// RUN: %test_debuginfo %s %t.out<br>-<br>-// FIXME: LLDB finds the wrong symbol for "C". <a>rdar://problem/14933867</a><br>-// XFAIL: darwin<br>-<br>-// DEBUGGER: delete breakpoints<br>-// DEBUGGER: break static-member.cpp:33<br>-// DEBUGGER: r<br>-// DEBUGGER: ptype C<br>-// CHECK: {{struct|class}} C {<br>-// CHECK: static const int a;<br>-// CHECK-NEXT: static int b;<br>-// CHECK-NEXT: static int c;<br>-// CHECK-NEXT: int d;<br>-// CHECK-NEXT: }<br>-// DEBUGGER: p C::a<br>-// CHECK: ${{[0-9]}} = 4<br>-// DEBUGGER: p C::c<br>-// CHECK: ${{[0-9]}} = 15<br>-<br>-// PR14471, PR14734<br>-<br>-class C {<br>-public:<br>- const static int a = 4;<br>- static int b;<br>- static int c;<br>- int d;<br>-};<br>-<br>-int C::c = 15;<br>-const int C::a;<br>-<br>-int main() {<br>- C instance_C;<br>- return C::a;<br>-}<br><br>Removed: debuginfo-tests/trunk/static-member.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/static-member.cpp?rev=318434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/static-member.cpp?rev=318434&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/static-member.cpp (original)<br>+++ debuginfo-tests/trunk/static-member.cpp (removed)<br>@@ -1,36 +0,0 @@<br>-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c<br>-// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out<br>-// RUN: %test_debuginfo %s %t.out<br>-<br>-// DEBUGGER: delete breakpoints<br>-// DEBUGGER: break static-member.cpp:33<br>-// DEBUGGER: r<br>-// DEBUGGER: ptype MyClass<br>-// CHECK: {{struct|class}} MyClass {<br>-// CHECK: static const int a;<br>-// CHECK-NEXT: static int b;<br>-// CHECK-NEXT: static int c;<br>-// CHECK-NEXT: int d;<br>-// CHECK-NEXT: }<br>-// DEBUGGER: p MyClass::a<br>-// CHECK: ${{[0-9]}} = 4<br>-// DEBUGGER: p MyClass::c<br>-// CHECK: ${{[0-9]}} = 15<br>-<br>-// PR14471, PR14734<br>-<br>-class MyClass {<br>-public:<br>- const static int a = 4;<br>- static int b;<br>- static int c;<br>- int d;<br>-};<br>-<br>-int MyClass::c = 15;<br>-const int MyClass::a;<br>-<br>-int main() {<br>- MyClass instance_MyClass;<br>- return MyClass::a;<br>-}<br><br>Added: debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp (added)<br>+++ debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,32 @@<br>+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>+// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br>+// RUN: %test_debuginfo %s %t.out<br>+// Radar 8945514<br>+// DEBUGGER: break 22<br>+// DEBUGGER: r<br>+// DEBUGGER: p v<br>+// CHECK: ${{[0-9]+}} =<br>+// CHECK: Data ={{.*}} 0x0{{(0*)}}<br>+// CHECK: Kind = 2142<br>+<br>+class SVal {<br>+public:<br>+ ~SVal() {}<br>+ const void* Data;<br>+ unsigned Kind;<br>+};<br>+<br>+void bar(SVal &v) {}<br>+class A {<br>+public:<br>+ void foo(SVal v) { bar(v); }<br>+};<br>+<br>+int main() {<br>+ SVal v;<br>+ v.Data = 0;<br>+ v.Kind = 2142;<br>+ A a;<br>+ a.foo(v);<br>+ return 0;<br>+}<br><br>Added: debuginfo-tests/trunk/tests/asan-blocks.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/asan-blocks.c?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/asan-blocks.c?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/asan-blocks.c (added)<br>+++ debuginfo-tests/trunk/tests/asan-blocks.c Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,41 @@<br>+// RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address<br>+// RUN: %test_debuginfo %s %t.out<br>+// FIXME: Remove system-darwin when we build BlocksRuntime everywhere.<br>+// REQUIRES: not_asan, system-darwin<br>+// Zorg configures the ASAN stage2 bots to not build the asan<br>+// compiler-rt. Only run this test on non-asanified configurations.<br>+void b();<br>+struct S {<br>+ int a[8];<br>+};<br>+<br>+int f(struct S s, unsigned i) {<br>+ // DEBUGGER: break 17<br>+ // DEBUGGER: r<br>+ // DEBUGGER: p s<br>+ // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)<br>+ return s.a[i];<br>+}<br>+<br>+int main(int argc, const char **argv) {<br>+ struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br>+ if (f(s, 4) == 4) {<br>+ // DEBUGGER: break 27<br>+ // DEBUGGER: c<br>+ // DEBUGGER: p s<br>+ // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)<br>+ b();<br>+ }<br>+ return 0;<br>+}<br>+<br>+void c() {}<br>+<br>+void b() {<br>+ // DEBUGGER: break 40<br>+ // DEBUGGER: c<br>+ // DEBUGGER: p x<br>+ // CHECK: 42<br>+ __block int x = 42;<br>+ c();<br>+}<br><br>Added: debuginfo-tests/trunk/tests/asan.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/asan.c?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/asan.c?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/asan.c (added)<br>+++ debuginfo-tests/trunk/tests/asan.c Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,31 @@<br>+// RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address<br>+// RUN: %test_debuginfo %s %t.out<br>+// REQUIRES: not_asan<br>+// Zorg configures the ASAN stage2 bots to not build the asan<br>+// compiler-rt. Only run this test on non-asanified configurations.<br>+//<br>+<br>+struct S {<br>+ int a[8];<br>+};<br>+<br>+int f(struct S s, unsigned i) {<br>+ // DEBUGGER: break 14<br>+ return s.a[i];<br>+}<br>+<br>+int main(int argc, const char **argv) {<br>+ struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br>+ if (f(s, 4) == 4)<br>+ return f(s, 0);<br>+ return 0;<br>+}<br>+<br>+// DEBUGGER: r<br>+// DEBUGGER: p s<br>+// CHECK: a =<br>+// DEBUGGER: p s.a[0]<br>+// CHECK: = 0<br>+// DEBUGGER: p s.a[1]<br>+// CHECK: = 1<br>+// DEBUGGER: p s.a[7]<br><br>Added: debuginfo-tests/trunk/tests/block_var.m<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/block_var.m?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/block_var.m?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/block_var.m (added)<br>+++ debuginfo-tests/trunk/tests/block_var.m Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,32 @@<br>+// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>+// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br>+// RUN: %test_debuginfo %s %t.out<br>+<br>+// REQUIRES: system-darwin<br>+<br>+// DEBUGGER: break 24<br>+// DEBUGGER: r<br>+// DEBUGGER: p result<br>+// CHECK: ${{[0-9]}} = 42<br>+<br>+void doBlock(void (^block)(void))<br>+{<br>+ block();<br>+}<br>+<br>+int I(int n)<br>+{<br>+ __block int result;<br>+ int i = 2;<br>+ doBlock(^{<br>+ result = n;<br>+ });<br>+ return result + i; /* Check value of 'result' */<br>+}<br>+<br>+<br>+int main (int argc, const char * argv[]) {<br>+ return I(42);<br>+}<br>+<br>+<br><br>Added: debuginfo-tests/trunk/tests/blocks.m<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/blocks.m?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/blocks.m?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/blocks.m (added)<br>+++ debuginfo-tests/trunk/tests/blocks.m Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,43 @@<br>+// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>+// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br>+// RUN: %test_debuginfo %s %t.out<br>+<br>+// REQUIRES: system-darwin<br>+// Radar 9279956<br>+<br>+// DEBUGGER: break 31<br>+// DEBUGGER: r<br>+// DEBUGGER: p m2<br>+// CHECK: ${{[0-9]}} = 1<br>+// DEBUGGER: p dbTransaction<br>+// CHECK: ${{[0-9]}} = 0<br>+// DEBUGGER: p master<br>+// CHECK: ${{[0-9]}} = 0<br>+<br>+#include <Cocoa/Cocoa.h><br>+<br>+extern void foo(void(^)(void));<br>+<br>+@interface A:NSObject @end<br>+@implementation A<br>+- (void) helper {<br>+ int master = 0;<br>+ __block int m2 = 0;<br>+ __block int dbTransaction = 0;<br>+ int (^x)(void) = ^(void) { (void) self;<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>(void) master;<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>(void) dbTransaction;<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>m2++;<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>return m2;<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>};<br>+ master = x();<br>+}<br>+@end<br>+<br>+void foo(void(^x)(void)) {}<br>+<br>+int main() {<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>A *a = [A alloc];<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>[a helper];<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>return 0;<br>+}<br><br>Added: debuginfo-tests/trunk/tests/ctor.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/ctor.cpp?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/ctor.cpp?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/ctor.cpp (added)<br>+++ debuginfo-tests/trunk/tests/ctor.cpp Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,25 @@<br>+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>+// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br>+// RUN: %test_debuginfo %s %t.out<br>+<br>+<br>+// DEBUGGER: break 14<br>+// DEBUGGER: r<br>+// DEBUGGER: p *this<br>+// CHECK-NEXT-NOT: Cannot access memory at address<br>+<br>+class A {<br>+public:<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>A() : zero(0), data(42)<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>{<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>}<br>+private:<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>int zero;<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>int data;<br>+};<br>+<br>+int main() {<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>A a;<br>+<span class="m_6477781719629286957m_-8058737202827010305m_-4538781832371837054m_7154758289788119411Apple-tab-span" style="white-space:pre-wrap"> </span>return 0;<br>+}<br>+<br><br>Added: debuginfo-tests/trunk/tests/dbg-arg.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/dbg-arg.c?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/dbg-arg.c?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/dbg-arg.c (added)<br>+++ debuginfo-tests/trunk/tests/dbg-arg.c Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,46 @@<br>+// This test case checks debug info during register moves for an argument.<br>+// RUN: %clang %target_itanium_abi_host_triple -m64 -mllvm -fast-isel=false %s -c -o %t.o -g<br>+// RUN: %clang %target_itanium_abi_host_triple -m64 %t.o -o %t.out<br>+// RUN: %test_debuginfo %s %t.out<br>+//<br>+// DEBUGGER: break 26<br>+// DEBUGGER: r<br>+// DEBUGGER: print mutex<br>+// CHECK: ={{.* 0x[0-9A-Fa-f]+}}<br>+//<br>+// Radar 8412415<br>+<br>+struct _mtx<br>+{<br>+ long unsigned int ptr;<br>+ int waiters;<br>+ struct {<br>+ int tag;<br>+ int pad;<br>+ } mtxi;<br>+};<br>+<br>+<br>+int foobar(struct _mtx *mutex) {<br>+ int r = 1;<br>+ int l = 0;<br>+ int j = 0;<br>+ do {<br>+ if (mutex->waiters) {<br>+ r = 2;<br>+ }<br>+ j = bar(r, l);<br>+ ++l;<br>+ } while (l < j);<br>+ return r + j;<br>+}<br>+<br>+int bar(int i, int j) {<br>+ return i + j;<br>+}<br>+<br>+int main() {<br>+ struct _mtx m;<br>+ m.waiters = 0;<br>+ return foobar(&m);<br>+}<br><br>Added: debuginfo-tests/trunk/tests/foreach.m<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/foreach.m?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/foreach.m?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/foreach.m (added)<br>+++ debuginfo-tests/trunk/tests/foreach.m Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,31 @@<br>+// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>+// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br>+// RUN: %test_debuginfo %s %t.out<br>+//<br>+// REQUIRES: system-darwin<br>+// Radar 8757124<br>+<br>+// DEBUGGER: break 25<br>+// DEBUGGER: r<br>+// DEBUGGER: po thing<br>+// CHECK: aaa<br>+<br>+#import <Foundation/Foundation.h><br>+<br>+int main (int argc, const char * argv[]) {<br>+<br>+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];<br>+ NSArray *things = [NSArray arrayWithObjects:@"one", @"two", @"three" , nil];<br>+ for (NSString *thing in things) {<br>+ NSLog (@"%@", thing);<br>+ }<br>+<br>+ things = [NSArray arrayWithObjects:@"aaa", @"bbb", @"ccc" , nil];<br>+ for (NSString *thing in things) {<br>+ NSLog (@"%@", thing);<br>+ }<br>+ [pool release];<br>+ return 0;<br>+}<br>+<br>+<br><br>Added: debuginfo-tests/trunk/tests/forward-declare-class.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/forward-declare-class.cpp?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/forward-declare-class.cpp?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/forward-declare-class.cpp (added)<br>+++ debuginfo-tests/trunk/tests/forward-declare-class.cpp Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,27 @@<br>+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>+// RUN: %test_debuginfo %s %t.o<br>+// Radar 9168773<br>+<br>+// DEBUGGER: ptype A<br>+// Work around a gdb bug where it believes that a class is a<br>+// struct if there aren't any methods - even though it's tagged<br>+// as a class.<br>+// CHECK: type = {{struct|class}} A {<br>+// CHECK-NEXT: {{(public:){0,1}}}<br>+// CHECK-NEXT: int MyData;<br>+// CHECK-NEXT: }<br>+class A;<br>+class B {<br>+public:<br>+ void foo(const A *p);<br>+};<br>+<br>+B iEntry;<br>+<br>+class A {<br>+public:<br>+ int MyData;<br>+};<br>+<br>+A irp;<br>+<br><br>Added: debuginfo-tests/trunk/tests/lit.local.cfg<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/lit.local.cfg?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/lit.local.cfg?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/lit.local.cfg (added)<br>+++ debuginfo-tests/trunk/tests/lit.local.cfg Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,3 @@<br>+# debuginfo-tests are not expected to pass in a cross-compilation setup.<br>+if 'native' not in config.available_features:<br>+ config.unsupported = True<br><br>Added: debuginfo-tests/trunk/tests/llgdb.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/llgdb.py?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/llgdb.py?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/llgdb.py (added)<br>+++ debuginfo-tests/trunk/tests/llgdb.py Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,157 @@<br>+#!/bin/env python<br>+"""<br>+A gdb-compatible frontend for lldb that implements just enough<br>+commands to run the tests in the debuginfo-tests repository with lldb.<br>+"""<br>+<br>+# ----------------------------------------------------------------------<br>+# Auto-detect lldb python module.<br>+import commands, platform, os, sys<br>+try:<br>+ # Just try for LLDB in case PYTHONPATH is already correctly setup.<br>+ import lldb<br>+except ImportError:<br>+ lldb_python_dirs = list()<br>+ # lldb is not in the PYTHONPATH, try some defaults for the current platform.<br>+ platform_system = platform.system()<br>+ if platform_system == 'Darwin':<br>+ # On Darwin, try the currently selected Xcode directory<br>+ xcode_dir = commands.getoutput("xcode-select --print-path")<br>+ if xcode_dir:<br>+ lldb_python_dirs.append(os.path.realpath(xcode_dir +<br>+'/../SharedFrameworks/LLDB.framework/Resources/Python'))<br>+ lldb_python_dirs.append(xcode_dir +<br>+'/Library/PrivateFrameworks/LLDB.framework/Resources/Python')<br>+ lldb_python_dirs.append(<br>+'/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')<br>+ success = False<br>+ for lldb_python_dir in lldb_python_dirs:<br>+ if os.path.exists(lldb_python_dir):<br>+ if not (sys.path.__contains__(lldb_python_dir)):<br>+ sys.path.append(lldb_python_dir)<br>+ try:<br>+ import lldb<br>+ except ImportError:<br>+ pass<br>+ else:<br>+ print 'imported lldb from: "%s"' % (lldb_python_dir)<br>+ success = True<br>+ break<br>+ if not success:<br>+ print "error: couldn't locate the 'lldb' module, please set PYTHONPATH correctly"<br>+ sys.exit(1)<br>+# ----------------------------------------------------------------------<br>+<br>+# Command line option handling.<br>+import argparse<br>+parser = argparse.ArgumentParser(description=__doc__)<br>+parser.add_argument('--quiet', '-q', action="store_true", help='ignored')<br>+parser.add_argument('-batch', action="store_true",<br>+ help='exit after processing comand line')<br>+parser.add_argument('-n', action="store_true", help='ignore .lldb file')<br>+parser.add_argument('-x', dest='script', type=file, help='execute commands from file')<br>+parser.add_argument("target", help="the program to debug")<br>+args = parser.parse_args()<br>+<br>+<br>+# Create a new debugger instance.<br>+debugger = lldb.SBDebugger.Create()<br>+debugger.SkipLLDBInitFiles(args.n)<br>+<br>+# Don't return from lldb function calls until the process stops.<br>+debugger.SetAsync(False)<br>+<br>+# Create a target from a file and arch.<br>+arch = os.popen("file "+args.target).read().split()[-1]<br>+target = debugger.CreateTargetWithFileAndArch(args.target, arch)<br>+<br>+if not target:<br>+ print "Could not create target", args.target<br>+ sys.exit(1)<br>+<br>+if not args.script:<br>+ print "Interactive mode is not implemented."<br>+ sys.exit(1)<br>+<br>+import re<br>+for command in args.script:<br>+ # Strip newline and whitespaces and split into words.<br>+ cmd = command[:-1].strip().split()<br>+ if not cmd:<br>+ continue<br>+<br>+ print '> %s'% command[:-1]<br>+<br>+ try:<br>+ if re.match('^r|(run)$', cmd[0]):<br>+ error = lldb.SBError()<br>+ launchinfo = lldb.SBLaunchInfo([])<br>+ launchinfo.SetWorkingDirectory(os.getcwd())<br>+ process = target.Launch(launchinfo, error)<br>+ print error<br>+ if not process or error.fail:<br>+ state = process.GetState()<br>+ print "State = %d" % state<br>+ print """<br>+ERROR: Could not launch process.<br>+NOTE: There are several reasons why this may happen:<br>+ * Root needs to run "DevToolsSecurity --enable".<br>+ * Older versions of lldb cannot launch more than one process simultaneously.<br>+"""<br>+ sys.exit(1)<br>+<br>+ elif re.match('^b|(break)$', cmd[0]) and len(cmd) == 2:<br>+ if re.match('[0-9]+', cmd[1]):<br>+ # b line<br>+ mainfile = target.FindFunctions('main')[0].compile_unit.file<br>+ print target.BreakpointCreateByLocation(mainfile, int(cmd[1]))<br>+ else:<br>+ # b file:line<br>+ file, line = cmd[1].split(':')<br>+ print target.BreakpointCreateByLocation(file, int(line))<br>+<br>+ elif re.match('^ptype$', cmd[0]) and len(cmd) == 2:<br>+ # GDB's ptype has multiple incarnations depending on its<br>+ # argument (global variable, function, type). The definition<br>+ # here is for looking up the signature of a function and only<br>+ # if that fails it looks for a type with that name.<br>+ # Type lookup in LLDB would be "image lookup --type".<br>+ for elem in target.FindFunctions(cmd[1]):<br>+ print elem.function.type<br>+ continue<br>+ print target.FindFirstType(cmd[1])<br>+<br>+ elif re.match('^po$', cmd[0]) and len(cmd) > 1:<br>+ try:<br>+ opts = lldb.SBExpressionOptions()<br>+ opts.SetFetchDynamicValue(True)<br>+ opts.SetCoerceResultToId(True)<br>+ print target.EvaluateExpression(' '.join(cmd[1:]), opts)<br>+ except:<br>+ # FIXME: This is a fallback path for the <a href="http://lab.llvm.org/" target="_blank">lab.llvm.org</a><br>+ # buildbot running OS X 10.7; it should be removed.<br>+ thread = process.GetThreadAtIndex(0)<br>+ frame = thread.GetFrameAtIndex(0)<br>+ print frame.EvaluateExpression(' '.join(cmd[1:]))<br>+<br>+ elif re.match('^p|(print)$', cmd[0]) and len(cmd) > 1:<br>+ thread = process.GetThreadAtIndex(0)<br>+ frame = thread.GetFrameAtIndex(0)<br>+ print frame.EvaluateExpression(' '.join(cmd[1:]))<br>+<br>+ elif re.match('^n|(next)$', cmd[0]):<br>+ thread = process.GetThreadAtIndex(0)<br>+ thread.StepOver()<br>+<br>+ elif re.match('^q|(quit)$', cmd[0]):<br>+ sys.exit(0)<br>+<br>+ else:<br>+ print debugger.HandleCommand(' '.join(cmd))<br>+<br>+ except SystemExit:<br>+ lldb.SBDebugger_Terminate()<br>+ raise<br>+ except:<br>+ print 'Could not handle the command "%s"' % ' '.join(cmd)<br>+<br><br>Added: debuginfo-tests/trunk/tests/nested-struct.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/nested-struct.cpp?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/nested-struct.cpp?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/nested-struct.cpp (added)<br>+++ debuginfo-tests/trunk/tests/nested-struct.cpp Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,21 @@<br>+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br>+// RUN: %test_debuginfo %s %t.o<br>+// Radar 9440721<br>+// If debug info for my_number() is emitted outside function foo's scope<br>+// then a debugger may not be able to handle it. At least one version of<br>+// gdb crashes in such cases.<br>+<br>+// DEBUGGER: ptype foo<br>+// CHECK: int (void)<br>+<br>+int foo() {<br>+ struct Local {<br>+ static int my_number() {<br>+ return 42;<br>+ }<br>+ };<br>+<br>+ int i = 0;<br>+ i = Local::my_number();<br>+ return i + 1;<br>+}<br><br>Added: debuginfo-tests/trunk/tests/nrvo-string.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/nrvo-string.cpp?rev=318435&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/nrvo-string.cpp?rev=318435&view=auto</a><br>==============================================================================<br>--- debuginfo-tests/trunk/tests/nrvo-string.cpp (added)<br>+++ debuginfo-tests/trunk/tests/nrvo-string.cpp Thu Nov 16 10:26:20 2017<br>@@ -0,0 +1,27 @@<br>+// This ensures that DW_OP_deref is inserted when necessary, such as when NRVO<br>+// of a string object occurs in C++.<br>+//<br>+// RUN: %clangxx -O0 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g<br>+// RUN: %test_debuginfo %s %t.out<br>+// RUN: %clangxx -O1 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g<br>+// RUN: %test_debuginfo %s %t.out<br>+//<br>+// PR34513<br>+<br>+struct string {<br>+ st</blockquote></blockquote></div></div></blockquote></div></div></div></blockquote></div></blockquote></div></div></blockquote></div></div></div></blockquote></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div>