Skip to content

Commit 3ba2467

Browse files
author
Thomas Preud'homme
committed
[test, AArch64] Fix use of var defined in CHECK-NOT
LLVM test CodeGen/AArch64/speculation-hardening.ll tries to check for the absence of a sequence of instructions with several CHECK-NOT with one of those directives using a variable defined in another. However CHECK-NOT are checked independently so that is using a variable defined in a pattern that should not occur in the input. This commit removes the dependency between those CHECK-NOT by replacing single occurence of the undefined variable by a regex match, and multiple occurences by a definition followed by a use. Reviewed By: aemerson Differential Revision: https://reviews.llvm.org/D99866
1 parent d0615a9 commit 3ba2467

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

llvm/test/CodeGen/AArch64/speculation-hardening.ll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ entry:
1616
; SLH: mov [[TMPREG:x[0-9]+]], sp
1717
; SLH: and [[TMPREG]], [[TMPREG]], x16
1818
; SLH: mov sp, [[TMPREG]]
19-
; NOSLH-NOT: mov [[TMPREG:x[0-9]+]], sp
20-
; NOSLH-NOT: and [[TMPREG]], [[TMPREG]], x16
21-
; NOSLH-NOT: mov sp, [[TMPREG]]
19+
; NOSLH-NOT: mov {{x[0-9]+}}, sp
20+
; NOSLH-NOT: and [[TMPREG:x[0-9]+]], [[TMPREG]], x16
21+
; NOSLH-NOT: mov sp, {{x[0-9]+}}
2222
%call = tail call i32 @tail_callee(i32 %i)
2323
; SLH: cmp sp, #0
2424
; SLH: csetm x16, ne
@@ -45,9 +45,9 @@ return: ; preds = %entry, %if.then
4545
; SLH: mov [[TMPREG:x[0-9]+]], sp
4646
; SLH: and [[TMPREG]], [[TMPREG]], x16
4747
; SLH: mov sp, [[TMPREG]]
48-
; NOSLH-NOT: mov [[TMPREG:x[0-9]+]], sp
49-
; NOSLH-NOT: and [[TMPREG]], [[TMPREG]], x16
50-
; NOSLH-NOT: mov sp, [[TMPREG]]
48+
; NOSLH-NOT: mov {{x[0-9]+}}, sp
49+
; NOSLH-NOT: and [[TMPREG:x[0-9]+]], [[TMPREG]], x16
50+
; NOSLH-NOT: mov sp, {{x[0-9]+}}
5151
ret i32 %retval.0
5252
}
5353

@@ -57,9 +57,9 @@ define i32 @tail_caller(i32 %a) local_unnamed_addr SLHATTR {
5757
; SLH: mov [[TMPREG:x[0-9]+]], sp
5858
; SLH: and [[TMPREG]], [[TMPREG]], x16
5959
; SLH: mov sp, [[TMPREG]]
60-
; NOSLH-NOT: mov [[TMPREG:x[0-9]+]], sp
61-
; NOSLH-NOT: and [[TMPREG]], [[TMPREG]], x16
62-
; NOSLH-NOT: mov sp, [[TMPREG]]
60+
; NOSLH-NOT: mov {{x[0-9]+}}, sp
61+
; NOSLH-NOT: and [[TMPREG:x[0-9]+]], [[TMPREG]], x16
62+
; NOSLH-NOT: mov sp, {{x[0-9]+}}
6363
; SLH: b tail_callee
6464
; SLH-NOT: cmp sp, #0
6565
%call = tail call i32 @tail_callee(i32 %a)

0 commit comments

Comments
 (0)