File: module-pass-printer.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (50 lines) | stat: -rw-r--r-- 3,008 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
; Check pass name is only printed once.
; Check only one function is printed
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=foo | FileCheck %s  -check-prefix=FOO
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=foo | FileCheck %s  -check-prefix=FOO

; Check pass name is only printed once.
; Check both functions are printed
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=foo,bar | FileCheck %s -check-prefix=BOTH
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=foo,bar | FileCheck %s -check-prefix=BOTH

; Check pass name is not printed if a module/SCC doesn't include any function specified in -filter-print-funcs.
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=baz | FileCheck %s -allow-empty -check-prefix=EMPTY
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=baz | FileCheck %s -allow-empty -check-prefix=EMPTY
; RUN: opt < %s 2>&1 -passes=no-op-cgscc -disable-output -print-after-all -filter-print-funcs=baz | FileCheck %s -allow-empty -check-prefix=EMPTY

; Check whole module is printed with user-specified wildcast switch -filter-print-funcs=* or -print-module-scope
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all | FileCheck %s -check-prefix=ALL
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output  -print-after-all -filter-print-funcs=* | FileCheck %s -check-prefix=ALL
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=foo -print-module-scope | FileCheck %s -check-prefix=ALL
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all | FileCheck %s -check-prefix=ALL
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=* | FileCheck %s -check-prefix=ALL
; RUN: opt < %s 2>&1 -passes=forceattrs -disable-output -print-after-all -filter-print-funcs=foo -print-module-scope | FileCheck %s -check-prefix=ALL

; FOO:      IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}}
; FOO:      define void @foo
; FOO-NOT:  define void @bar
; FOO-NOT:  IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}}

; BOTH:     IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}}
; BOTH:     define void @foo
; BOTH:     define void @bar
; BOTH-NOT: IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}}
; BOTH-NOT: ModuleID =

; EMPTY-NOT: IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}}
; EMPTY-NOT: IR Dump After NoOp

; ALL:  IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}}
; ALL:  ModuleID =
; ALL:  define void @foo
; ALL:  define void @bar
; ALL-NOT: IR Dump After {{Force set function attributes|ForceFunctionAttrsPass}}

define void @foo() {
  ret void
}

define void @bar() {
  ret void
}