<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63746>63746</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Update Test Check duplicates global check lines.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
hnrklssn
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jdoerfert
</td>
</tr>
</table>
<pre>
Since https://reviews.llvm.org/D148216 global check lines are not cleared properly:
```
cat test.ll
-----------
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals --version 2
; RUN: opt -S < %s | FileCheck %s
@G = constant i32 42
;.
; CHECK: @G = constant i32 42
;.
define ptr @foo() {
; CHECK-LABEL: define ptr @foo() {
; CHECK-NEXT: ret ptr @G
;
ret ptr @G
}
```
`./llvm/utils/update_test_checks.py --check-globals=all test.ll`
```
cat test.ll
-----------
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals --version 2
; RUN: opt -S < %s | FileCheck %s
@G = constant i32 42
; CHECK: @G = constant i32 42
;.
; CHECK: @G = constant i32 42
;.
define ptr @foo() {
; CHECK-LABEL: define ptr @foo() {
; CHECK-NEXT: ret ptr @G
;
ret ptr @G
}
```
`./llvm/utils/update_test_checks.py --check-globals=all test.ll`
```
cat test.ll
-----------
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals --version 2
; RUN: opt -S < %s | FileCheck %s
@G = constant i32 42
; CHECK: @G = constant i32 42
; CHECK: @G = constant i32 42
;.
; CHECK: @G = constant i32 42
;.
define ptr @foo() {
; CHECK-LABEL: define ptr @foo() {
; CHECK-NEXT: ret ptr @G
;
ret ptr @G
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzslk9vozwQxj-NuYxAjiE4HDjkH32lt-pKbSrtrTJmEty6NrJNqnz7FSRNtlW1q572kihCMPbzjM38LEZ4r3YGsSTTBWGsNe5Fe28IY2S6ikQfWuvK58ai26ILUW2bQ_mgjERoQ-g8SeeEVYRVDvcK33yi9f41sW5HWLWaZDM2yWGnbS00yBblC2hl0INwCMYGkBqFwwY6Zzt0-jDY0RWh79ecnv7joxQBAvqQaH0MxJcfnBTpAu5-bNYkncPce3RBWeOhFXuEGtGA6IPdoUEnAjZQH6APSnvCqr5rRMCnwf9pXKpPugM8bpZP8_ubh8Evjsd4fNyPhzjeo_PKGmCX5PePd8Nc2wWIH4CkSyBs6oHwJVRK43J8CUPowz4zegMkXYG0xgdhAqiUQcY-zEkXySXN8r_18v8h0V-kZ1GDW2UQuuAGydZawmaEFUD44pNrfDtfrG8H729o7tY_N4MEAByGd8nNedrx5stBvvqy2OdgQlg1UDXU6I-1-lQfkq6E1mdgzr5Xpn5n6vskXfG74vcv8LuS-pnUqCnTpkgLEWE5yWczPs0LyqO2ZMVsW_OaMUprWUvOc9oIJuSspnkupyxSJaMspZzySUFnjCeTjDcTrCUvOMcGM5JRfBVKn7_nkfK-xzJPeZZHWtSo_allMPgG4-CpZ3DloInrfudJRrXy4dIVREEFjeXjCCZs0Ac44tP0nVZSBPRftAtJ1Dtdfuw3diq0fZ1I-3o5n2PeztlnlIGwalzUcA7GRf8KAAD__3Y2grY">