llvm-project/llvm/test/Transforms/Util/annotation-remarks.ll
Bjorn Pettersson 211cf8a384 [test] Use -passes in more Transforms tests
Another step towards getting rid of dependencies to the legacy
pass manager.

Primary change here is to just do -passes=foo instead of -foo in
simple situations (when running a single transform pass). But also
updated a few test running multiple passes.

Also removed some "duplicated" RUN lines in a few tests that where
using both -foo and -passes=foo syntax. No need to do the same kind
of testing twice.
2022-10-21 17:02:02 +02:00

51 lines
1.7 KiB
LLVM

; RUN: opt -passes='annotation-remarks' -pass-remarks-missed='annotation-remarks' -disable-output -pass-remarks-output=%t.opt.yaml %s
; RUN: FileCheck --input-file=%t.opt.yaml %s
; CHECK: --- !Analysis
; CHECK-NEXT: Pass: annotation-remarks
; CHECK-NEXT: Name: AnnotationSummary
; CHECK-NEXT: Function: test1
; CHECK-NEXT: Args:
; CHECK-NEXT: - String: 'Annotated '
; CHECK-NEXT: - count: '4'
; CHECK-NEXT: - String: ' instructions with '
; CHECK-NEXT: - type: _remarks1
; CHECK-NEXT: ...
; CHECK-NEXT: --- !Analysis
; CHECK-NEXT: Pass: annotation-remarks
; CHECK-NEXT: Name: AnnotationSummary
; CHECK-NEXT: Function: test1
; CHECK-NEXT: Args:
; CHECK-NEXT: - String: 'Annotated '
; CHECK-NEXT: - count: '3'
; CHECK-NEXT: - String: ' instructions with '
; CHECK-NEXT: - type: _remarks2
; CHECK-NEXT: ...
; CHECK-NEXT: --- !Analysis
; CHECK-NEXT: Pass: annotation-remarks
; CHECK-NEXT: Name: AnnotationSummary
; CHECK-NEXT: Function: test2
; CHECK-NEXT: Args:
; CHECK-NEXT: - String: 'Annotated '
; CHECK-NEXT: - count: '2'
; CHECK-NEXT: - String: ' instructions with '
; CHECK-NEXT: - type: _remarks1
; CHECK-NEXT: ...
define void @test1(ptr %a) {
entry:
%a.addr = alloca ptr, align 8, !annotation !0
store ptr null, ptr %a.addr, align 8, !annotation !1
store ptr %a, ptr %a.addr, align 8, !annotation !0
ret void, !annotation !0
}
define void @test2(ptr %a) {
entry:
%a.addr = alloca ptr, align 8, !annotation !1
ret void, !annotation !1
}
!0 = !{!"_remarks1", !"_remarks2"}
!1 = !{!"_remarks1"}