; REQUIRES: x86_64-linux ; RUN: mkdir -p %t ; RUN: llvm-ctxprof-util fromYAML --input %S/Inputs/empty.yaml -output %t/empty.bitstream ; RUN: llvm-bcanalyzer --dump %t/empty.bitstream | FileCheck %s --check-prefix=EMPTY ; RUN: llvm-ctxprof-util fromYAML -input %S/Inputs/valid.yaml -output %t/valid.bitstream ; RUN: llvm-ctxprof-util toYAML -input %t/valid.bitstream -output %t/valid2.yaml ; RUN: diff %t/valid2.yaml %S/Inputs/valid.yaml ; RUN: llvm-ctxprof-util fromYAML -input %S/Inputs/valid-ctx-only.yaml -output %t/valid-ctx-only.bitstream ; RUN: llvm-ctxprof-util toYAML -input %t/valid-ctx-only.bitstream -output %t/valid-ctx-only.yaml ; RUN: diff %t/valid-ctx-only.yaml %S/Inputs/valid-ctx-only.yaml ; RUN: llvm-ctxprof-util fromYAML -input %S/Inputs/valid-flat-only.yaml -output %t/valid-flat-only.bitstream ; RUN: llvm-ctxprof-util toYAML -input %t/valid-flat-only.bitstream -output %t/valid-flat-only.yaml ; RUN: diff %t/valid-flat-only.yaml %S/Inputs/valid-flat-only.yaml ; This case is the "valid.yaml" case but with the flat profile first. ; The output, though, should match valid.yaml ; RUN: llvm-ctxprof-util fromYAML -input %S/Inputs/valid-flat-first.yaml -output %t/valid-flat-first.bitstream ; RUN: llvm-ctxprof-util toYAML -input %t/valid-flat-first.bitstream -output %t/valid-flat-first.yaml ; RUN: diff %t/valid-flat-first.yaml %S/Inputs/valid.yaml ; A variant with unhandled contexts: ; RUN: llvm-ctxprof-util fromYAML -input %S/Inputs/valid-with-unhandled.yaml -output %t/valid-with-unhandled.bitstream ; RUN: llvm-ctxprof-util toYAML -input %t/valid-with-unhandled.bitstream -output %t/valid-with-unhandled.yaml ; RUN: diff %t/valid-with-unhandled.yaml %S/Inputs/valid-with-unhandled.yaml ; For the valid case, check against a reference output. ; Note that uint64_t are printed as signed values by llvm-bcanalyzer: ; * 18446744073709551613 in yaml is -3 in the output ; * 18446744073709551612 in yaml is -4 in the output ; Also we have no callee/context at index 0, 2 callsites for index 1, and one for ; index 2. ; RUN: llvm-bcanalyzer --dump %t/valid.bitstream | FileCheck %s --check-prefix=VALID ; EMPTY: ; EMPTY-NEXT: ; EMPTY-NEXT: ; EMPTY-NEXT: ; VALID: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: ; VALID-NEXT: