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

    <tr>
        <th>Summary</th>
        <td>
            Failing test debug-types-dwo-cross-reference.cpp.tmp
        </td>
    </tr>

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

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

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

<pre>
    I am trying to build clang using the test-release.sh script https://github.com/llvm/llvm-project/blob/main/llvm/utils/release/test-release.sh , this was successful on clang 17.0.6 (with some file differences between phase 2 and 3). but no test failures, and check-all passed.

running as
```
 ./test-release.sh -j 5 -release $VERSION -use-ninja -final -triple x86_64-linux-gnu
```

however when doing the 18.1.8 version (or any of the 18 versions) it fails in the following test

https://github.com/llvm/llvm-project/blob/main/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp

```
******************** TEST 'lldb-shell :: SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 6: /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/clang --target=specify-a-target-or-use-a-_host-substitution /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp -target x86_64-pc-linux -fno-standalone-debug -g    -fdebug-types-section -gsplit-dwarf -c -o /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp1.o -DONE
+ /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/clang --target=specify-a-target-or-use-a-_host-substitution /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp -target x86_64-pc-linux -fno-standalone-debug -g -fdebug-types-section -gsplit-dwarf -c -o /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp1.o -DONE
RUN: at line 8: /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/clang --target=specify-a-target-or-use-a-_host-substitution /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp -target x86_64-pc-linux -fno-standalone-debug -g    -fdebug-types-section -gsplit-dwarf -c -o /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp2.o -DTWO
+ /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/clang --target=specify-a-target-or-use-a-_host-substitution /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp -target x86_64-pc-linux -fno-standalone-debug -g -fdebug-types-section -gsplit-dwarf -c -o /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp2.o -DTWO
RUN: at line 10: llvm-dwarfdump /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp1.dwo -debug-types -debug-info | /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/FileCheck --check-prefix=ONEUNIT /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp
+ llvm-dwarfdump /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp1.dwo -debug-types -debug-info
+ /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/FileCheck --check-prefix=ONEUNIT /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp
RUN: at line 11: llvm-dwarfdump /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp2.dwo -debug-types -debug-info | /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/FileCheck --check-prefix=ONEUNIT /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp
+ llvm-dwarfdump /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp2.dwo -debug-types -debug-info
+ /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/FileCheck --check-prefix=ONEUNIT /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp
RUN: at line 12: /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/ld.lld /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp1.o /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp2.o -o /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp
+ /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/ld.lld /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp1.o /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp2.o -o /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp
ld.lld: warning: cannot find entry symbol _start; not setting start address
RUN: at line 13: /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/lldb --no-lldbinit -S /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/lit-lldb-init-quiet /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp -o "target var a b **b.a" -b | /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/FileCheck /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp
+ /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/lldb --no-lldbinit -S /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/lit-lldb-init-quiet /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp -o 'target var a b **b.a' -b
+ /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/FileCheck /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp
error: can't find global variable '**b.a'
/git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp:21:11: error: CHECK: expected string not found in input
// CHECK: (const A) **b.a = (a = 42)
          ^
<stdin>:10:2: note: scanning from here
}
 ^

Input file: <stdin>
Check file: /git/llvm-project/llvm/utils/release/final/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-dwo-cross-reference.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
 .
          .
          .
          5: Current executable set to '/git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp' (x86_64).
          6: (lldb) target var a b **b.a
          7: (const A) a = (a = 42)
          8: (const B) b = {
          9:  a = 0x00000000002031d8
         10: }
check:21      X error: no match found
>>>>>>

--

********************
```


The lldb version seems to be breaking the tests, if i use the old lldb it seems to work as expected.

eg. 

running the same command

```
lldb --no-lldbinit -S /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/lit-lldb-init-quiet /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp -o "target var a b **b.a" 
```

with the old version

```
$lldb --version
lldb version 17.0.6 (https://github.com/llvm/llvm-project revision 836ca5bbf7d6366df7c35ec9d1f235b1ebc9744e)
  clang revision 836ca5bbf7d6366df7c35ec9d1f235b1ebc9744e
  llvm revision 836ca5bbf7d6366df7c35ec9d1f235b1ebc9744e
$lldb --no-lldbinit -S /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/lit-lldb-init-quiet /git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp -o "target var a b **b.a"
(lldb)
(const A) a = (a = 42)
(const B) b = {
  a = 0x00000000002031d8
}
(const A) **b.a = (a = 42)

(lldb) target variable -r .*
(const A) a = (a = 42)
(const A *) ::a_ptr = 0x00000000002001c8
(const B) ::b = {
  a = 0x00000000002031d8
}

(lldb) p **b.a
(const A)  (a = 42)

```

with the newer version

```
$/git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/lldb --version
lldb version 18.1.0rc (https://github.com/llvm/llvm-project revision 4e0a0eae58f7a6998866719f7eb970096a2a52e9)
  clang revision 4e0a0eae58f7a6998866719f7eb970096a2a52e9
  llvm revision 4e0a0eae58f7a6998866719f7eb970096a2a52e9
$/git/git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/bin/lldb --no-lldbinit -S /git/git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/lit-lldb-init-quiet /git/git/llvm-project/llvm/utils/release/final/Phase3/Release/llvmCore-18.1.0-final.obj/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/debug-types-dwo-cross-reference.cpp.tmp -o "target var a b **b.a"
(lldb) target var a b **b.a
(const A) a = (a = 42)
(const B) b = {
  a = 0x00000000002031d8
}
error: can't find global variable '**b.a'

(lldb) target variable -r .*
(const A) a = (a = 42)
(const A *) ::a_ptr = 0x00000000002001c8
(const B) ::b = {
  a = 0x00000000002031d8
}

(lldb) p **b.a
(const A)  (a = 42)
```

note: the same variables exist, i think its just that the older version is more lax on the rules and just prints the expression, whereas the new version only looks for global variables that actually exist




</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsW9Fz2jwS_2uclx15jAzYfuAhJWGuczftTdvvvnvryPYaKxWST5ID-e9vJNtASJomTa9w-WAYgy1pvbv67W8lszBj-FIizoLJu2BydcFaWys9a1grblQtjVWSRlF2kavybvYe2AqsvuNyCVZB3nJRQiGYXEJr_MUawaKxRKNAZjA0NZhC88ZCbW1jgvgyoIuALpbc1m0eFmoV0IUQt8MHabS6wcIGdJELlQd0sWJc7vq0lgsT0EUvP6CLw9sFdA625gbWzIBpiwKNqVoBSvaajpIwCqcQ0HTNbQ1GrRAqLhBKXlWoURZoIEe7RpTQ1MwgUGCyhDigWQh5a0EqbyVUjItWo3H3dD2KGotvhAkBDTMGyzCIroLosjvqVkrnI2b6q9Oof_tTCB8xhtzABIYLENDxv64_fX7_8QOQ1iCRXN4wIBWXTACxmjcCYZNOv07HRHDZbshSto_erDvWao23qGFdo4RSDRM4SsNRmMItasOVdI5SGpi8A1X17UObCWgGvPODAS59c6WEUGsvDI29d7_XQqDMex8FdPG5RiHc590qV2LBhQPD1Z-Xn5zsTToN6KLEvF0Se9egIeVakUIrY4jGfpbDomn21Tv0Ef35N3y5_vwFApo4nYlxqoIzPL6EV-pLE1hcvv_H9RW8Rr_OwusNtzBXJTq9RvuumKvVygH6Y2ub1joIGFui1gHNnBm-DyHd56c_PrjxzILgEmHqTrrpfTih341ij-GALv7p4i0O6OLTtsmNmSuNxOMy6uAeqvzGAcQDo4trQizTS7RBfGUaLHh1R1h_iSjtA4aRr7Uylpg2N5bb1nb4_kldH_T_9fCE3oAhqpuiC2wglVTEWCZLJpRE4mUBWQIAkGpfssHCm0mWphHcknLNdAWkAKJ-2zRZpbygF7uow9_zfBXaVTMKFZCrjx-u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