52 lines · plain
1# Test the --dump-dot-func option with multiple functions 2# (includes tests for both mangled/unmangled names)3 4RUN: %clangxx %p/Inputs/multi-func.cpp -o %t.exe -Wl,-q5 6# Test 1: --dump-dot-func with specific function name (mangled)7RUN: llvm-bolt %t.exe -o %t.bolt1 --dump-dot-func=_Z3addii -v=1 2>&1 | FileCheck %s --check-prefix=ADD8 9# Test 2: --dump-dot-func with regex pattern (main.*)10RUN: llvm-bolt %t.exe -o %t.bolt2 --dump-dot-func="main.*" -v=1 2>&1 | FileCheck %s --check-prefix=MAIN-REGEX11 12# Test 3: --dump-dot-func with multiple specific functions (mangled names)13RUN: llvm-bolt %t.exe -o %t.bolt3 --dump-dot-func=_Z3addii,_Z8multiplyii -v=1 2>&1 | FileCheck %s --check-prefix=MULTI14 15# Test 4: No option specified should create no dot files16RUN: llvm-bolt %t.exe -o %t.bolt4 2>&1 | FileCheck %s --check-prefix=NONE17 18# Test 5: --dump-dot-func with non-existent function19RUN: llvm-bolt %t.exe -o %t.bolt5 --dump-dot-func=nonexistent -v=1 2>&1 | FileCheck %s --check-prefix=NONEXISTENT20 21# Test 6: Backward compatibility - --dump-dot-all should still work22RUN: llvm-bolt %t.exe -o %t.bolt6 --dump-dot-all -v=1 2>&1 | FileCheck %s --check-prefix=ALL23 24# Test 7: Test with unmangled function name (main function)25RUN: llvm-bolt %t.exe -o %t.bolt7 --dump-dot-func=main -v=1 2>&1 | FileCheck %s --check-prefix=MAIN-UNMANGLED26 27# Check that specific functions are dumped28ADD: BOLT-INFO: dumping CFG to _Z3addii-00_build-cfg.dot29ADD-NOT: BOLT-INFO: dumping CFG to main-00_build-cfg.dot30ADD-NOT: BOLT-INFO: dumping CFG to _Z8multiplyii-00_build-cfg.dot31ADD-NOT: BOLT-INFO: dumping CFG to _Z11main_helperv-00_build-cfg.dot32 33MAIN-REGEX-DAG: BOLT-INFO: dumping CFG to main-00_build-cfg.dot34MAIN-REGEX-NOT: BOLT-INFO: dumping CFG to _Z3addii-00_build-cfg.dot35MAIN-REGEX-NOT: BOLT-INFO: dumping CFG to _Z8multiplyii-00_build-cfg.dot36 37MULTI-DAG: BOLT-INFO: dumping CFG to _Z3addii-00_build-cfg.dot38MULTI-DAG: BOLT-INFO: dumping CFG to _Z8multiplyii-00_build-cfg.dot39MULTI-NOT: BOLT-INFO: dumping CFG to main-00_build-cfg.dot40MULTI-NOT: BOLT-INFO: dumping CFG to _Z11main_helperv-00_build-cfg.dot41 42# Should be no dumping messages when no option is specified43NONE-NOT: BOLT-INFO: dumping CFG44 45# Should be no dumping messages for non-existent function46NONEXISTENT-NOT: BOLT-INFO: dumping CFG47 48ALL: BOLT-INFO: dumping CFG to main-00_build-cfg.dot49 50MAIN-UNMANGLED: BOLT-INFO: dumping CFG to main-00_build-cfg.dot51MAIN-UNMANGLED-NOT: BOLT-INFO: dumping CFG to _Z3addii-00_build-cfg.dot52MAIN-UNMANGLED-NOT: BOLT-INFO: dumping CFG to _Z8multiplyii-00_build-cfg.dot