; CHECK-DOT-CFG-SIMPLE-NEXT: 0.0. Initial IR
; CHECK-DOT-CFG-SIMPLE-NEXT: 0.1. Initial IR
; CHECK-DOT-CFG-SIMPLE-NEXT:
; Simple checks of -print-changed=dot-cfg ; ; Note that (mostly) only the banners are checked. ; ; Simple functionality check. ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes=instsimplify -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 5 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-SIMPLE ; ; Check that only the passes that change the IR are printed and that the ; others (including g) are filtered out. ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes=instsimplify -filter-print-funcs=f -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 3 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-FUNC-FILTER ; ; Check that the reporting of IRs respects is not affected by ; -print-module-scope ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes=instsimplify -print-module-scope -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 5 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-PRINT-MOD-SCOPE ; ; Check that reporting of multiple functions happens ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes=instsimplify -filter-print-funcs="f,g" -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 5 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-FILTER-MULT-FUNC ; ; Check that the reporting of IRs respects -filter-passes ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes="instsimplify,no-op-function" -filter-passes="no-op-function" -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 3 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-FILTER-PASSES ; ; Check that the reporting of IRs respects -filter-passes with multiple passes ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 5 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-FILTER-MULT-PASSES ; ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 3 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-FILTER-FUNC-PASSES ; ; Check that repeated passes that change the IR are printed and that the ; others (including g) are filtered out. Note that only the first time ; instsimplify is run on f will result in changes ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes="instsimplify,instsimplify" -filter-print-funcs=f -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 3 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-MULT-PASSES-FILTER-FUNC ; ; Simple checks of -print-changed=dot-cfg-quiet ; ; Note that (mostly) only the banners are checked. ; ; Simple functionality check. ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -S -print-changed=dot-cfg-quiet -passes=instsimplify -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 3 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-SIMPLE --allow-empty ; ; Check that only the passes that change the IR are printed and that the ; others (including g) are filtered out. ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -S -print-changed=dot-cfg-quiet -passes=instsimplify -filter-print-funcs=f -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 2 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-FUNC-FILTER ; ; Check that the reporting of IRs respects is not affected by ; -print-module-scope ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -S -print-changed=dot-cfg-quiet -passes=instsimplify -print-module-scope -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 3 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-PRINT-MOD-SCOPE ; ; Check that reporting of multiple functions happens ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -S -print-changed=dot-cfg-quiet -passes=instsimplify -filter-print-funcs="f,g" -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 3 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-FILTER-MULT-FUNC ; ; Check that the reporting of IRs respects -filter-passes ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -S -print-changed=dot-cfg-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function" -dot-cfg-dir=%t < %s -o /dev/null ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-FILTER-PASSES-NONE --allow-empty ; ; Check that the reporting of IRs respects -filter-passes with multiple passes ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -S -print-changed=dot-cfg-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 3 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-FILTER-MULT-PASSES ; ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -S -print-changed=dot-cfg-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 2 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-FILTER-FUNC-PASSES ; ; Check that repeated passes that change the IR are printed and that the ; others (including g) are filtered out. Note that only the first time ; instsimplify is run on f will result in changes ; RUN: rm -rf %t && mkdir -p %t ; RUN: opt -S -print-changed=dot-cfg-quiet -passes="instsimplify,instsimplify" -filter-print-funcs=f -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 2 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-MULT-PASSES-FILTER-FUNC define i32 @g() { entry: %a = add i32 2, 3 ret i32 %a } define i32 @f() { entry: %a = add i32 2, 3 ret i32 %a } ; CHECK-DOT-CFG-SIMPLE-FILES: passes.html diff_0.pdf diff_1.pdf diff_3.pdf ; CHECK-DOT-CFG-SIMPLE:
; CHECK-DOT-CFG-SIMPLE-NEXT: 0.0. Initial IR
; CHECK-DOT-CFG-SIMPLE-NEXT: 0.1. Initial IR
; CHECK-DOT-CFG-SIMPLE-NEXT:
; CHECK-DOT-CFG-FUNC-FILTER-NEXT: 0.0. Initial IR
; CHECK-DOT-CFG-FUNC-FILTER-NEXT:
; CHECK-DOT-CFG-PRINT-MOD-SCOPE-NEXT: 0.0. Initial IR
; CHECK-DOT-CFG-PRINT-MOD-SCOPE-NEXT: 0.1. Initial IR
; CHECK-DOT-CFG-PRINT-MOD-SCOPE-NEXT:
; CHECK-DOT-CFG-FILTER-MULT-FUNC-NEXT: 0.0. Initial IR
; CHECK-DOT-CFG-FILTER-MULT-FUNC-NEXT: 0.1. Initial IR
; CHECK-DOT-CFG-FILTER-MULT-FUNC-NEXT:
; CHECK-DOT-CFG-FILTER-PASSES-NEXT: 0.0. Initial IR
; CHECK-DOT-CFG-FILTER-PASSES-NEXT: 0.1. Initial IR
; CHECK-DOT-CFG-FILTER-PASSES-NEXT:
; CHECK-DOT-CFG-FILTER-MULT-PASSES-NEXT: 0.0. Initial IR
; CHECK-DOT-CFG-FILTER-MULT-PASSES-NEXT: 0.1. Initial IR
; CHECK-DOT-CFG-FILTER-MULT-PASSES-NEXT: