<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/68044>68044</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [lldb] API test TestUnalignedWatchpoint.UnalignedWatchpointTestCase fails on M1 Macs
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          curiouserrandy
      </td>
    </tr>
</table>

<pre>
    I'm attempting to create a good development environment for contributing to lldb, and as part of that process, I've been running the lldb tests on my M1 laptop.  The above test fails in that environment, apparently because it is expecting the stop reason to be "watchpoint" but instead it is "EXC_BREAKPOINT".  Full test output at end of issue.  

Source is a clean pull at commit: 0b07b06effe5fdf779b75bb5ac6cf15e477cb0be (10/2, "[Sema] Use underlying type of scoped enum for -Wformat diagnostics")

Machine on which tests are running is a MacBook Air, M1 2020 running OS version 13.5 (22G74).

----

randys-macbook-air:../llvm-build-debug/build $ ninja check-lldb-api
[A lot of clean building]

[1459.212: 1/566/567] Running lldb api test suite
-- Testing: 1137 tests, 8 workers --
Testing: 
FAIL: lldb-api :: commands/watchpoints/unaligned-watchpoint/TestUnalignedWatchpoint.py (1 of 1137)
******************** TEST 'lldb-api :: commands/watchpoints/unaligned-watchpoint/TestUnalignedWatchpoint.py' FAILED ********************
Script:
--
/usr/local/Frameworks/Python.framework/Versions/3.11/bin/python3.11 /Users/randy/Checkouts/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env OBJCOPY=/Users/randy/Checkouts/llvm-build-debug/build/./bin/llvm-objcopy --codesign-identity - --env LLVM_LIBS_DIR=/Users/randy/Checkouts/llvm-build-debug/build/./lib --env LLVM_INCLUDE_DIR=/Users/randy/Checkouts/llvm-build-debug/build/include --env LLVM_TOOLS_DIR=/Users/randy/Checkouts/llvm-build-debug/build/./bin --libcxx-include-dir /Users/randy/Checkouts/llvm-build-debug/build/include/c++/v1 --libcxx-library-dir /Users/randy/Checkouts/llvm-build-debug/build/lib --arch x86_64 --build-dir /Users/randy/Checkouts/llvm-build-debug/build/lldb-test-build.noindex --lldb-module-cache-dir /Users/randy/Checkouts/llvm-build-debug/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/randy/Checkouts/llvm-build-debug/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /Users/randy/Checkouts/llvm-build-debug/build/./bin/lldb --compiler /Users/randy/Checkouts/llvm-build-debug/build/./bin/clang --dsymutil /Users/randy/Checkouts/llvm-build-debug/build/./bin/dsymutil --llvm-tools-dir /Users/randy/Checkouts/llvm-build-debug/build/./bin --lldb-libs-dir /Users/randy/Checkouts/llvm-build-debug/build/./lib /Users/randy/Checkouts/llvm-project/lldb/test/API/commands/watchpoints/unaligned-watchpoint -p TestUnalignedWatchpoint.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 18.0.0git (https://github.com/llvm/llvm-project.git revision 0b07b06effe5fdf779b75bb5ac6cf15e477cb0be)
  clang revision 0b07b06effe5fdf779b75bb5ac6cf15e477cb0be
  llvm revision 0b07b06effe5fdf779b75bb5ac6cf15e477cb0be
Skipping the following test categories: ['libstdcxx', 'dwo', 'llgs', 'fork']

--
Command Output (stderr):
--
FAIL: LLDB (/Users/randy/Checkouts/llvm-build-debug/build/bin/clang-x86_64) :: test_unaligned_watchpoint (TestUnalignedWatchpoint.UnalignedWatchpointTestCase)
======================================================================
FAIL: test_unaligned_watchpoint (TestUnalignedWatchpoint.UnalignedWatchpointTestCase)
   Test an unaligned watchpoint triggered by a larger aligned write.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/randy/Checkouts/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 166, in wrapper
    return func(*args, **kwargs)
 ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/randy/Checkouts/llvm-project/lldb/test/API/commands/watchpoints/unaligned-watchpoint/TestUnalignedWatchpoint.py", line 36, in test_unaligned_watchpoint
    self.expect(
  File "/Users/randy/Checkouts/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2521, in expect
    self.fail(log_msg)
AssertionError: Ran command:
"thread list"

Got output:
Process 89533 stopped
* thread #1: tid = 0x25c473, 0x0000000100003f43 a.out`main at main.c:10:9, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=EXC_I386_SGL, subcode=0x30410f2c0)

Expecting sub string: "stopped" (was found)
Expecting sub string: "stop reason = watchpoint" (was not found)
Process should be stopped due to watchpoint
Config=x86_64-/Users/randy/Checkouts/llvm-build-debug/build/bin/clang
----------------------------------------------------------------------
Ran 1 test in 18.243s

RESULT: FAILED (0 passes, 1 failures, 0 errors, 0 skipped, 0 expected failures, 0 unexpected successes)

--


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWF9T4zgS_zTipcsuW87fBx4CwVPchYUamN25J0qW24kGWfJJMiTf_kqynQRqZneGsHdVR7mCZUn999fqVjNrxVohnpPxBRkvz1jrNtqc89YI3Vo0hqlyd1bocnd-Tei0BuYc1o0Tag1OAzfIHAKDtdYllPiMUjc1KgeonoXRKrxX2gDXyhlRtMNOKcuC0EtgqgRmoWHGga7AbZiDxmiO1vppz_QZoUBUYFqlwu4Nhu3g0DoLWkG9g5sUJGucbmKAhw0CK_QzhhVQMSEtCNURPxIs8G8aZlA5uYMCOWstgnAgLOC2Qe4GftbpBgwyq5WXvkAglL4wxzeNFp4ShaJ1IJR1yMqeBKH06uvl48Xnq8U_726vf3sglMYAeStlJ5luXdM6CFKVXn1hbYsxAEmWJFl0v_e6NRw9PQZcIlPQeALMAdd1LRzJFpAUybRIJlhVOK7KajqdF9NxUYwZn_AqHeNoOuVFEqSepQmhOfW6E0rJ-OIea0bGS_hiEVpVopG7oPWuQS-S5brBElC1dXBk9EelTc0clIKtlbZOcOsJ0fmx0DeMb4RC75yXjeCb3lfM4N6NQaEbxi-0fo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