brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.1 KiB · 428f1db Raw
88 lines · plain
1; REQUIRES: x86_64-linux2 3; RUN: mkdir -p %t4; RUN: llvm-ctxprof-util fromYAML --input %S/Inputs/empty.yaml -output %t/empty.bitstream5; RUN: llvm-bcanalyzer --dump %t/empty.bitstream | FileCheck %s --check-prefix=EMPTY6 7; RUN: llvm-ctxprof-util fromYAML -input %S/Inputs/valid.yaml -output %t/valid.bitstream8; RUN: llvm-ctxprof-util toYAML -input %t/valid.bitstream -output %t/valid2.yaml9; RUN: diff %t/valid2.yaml %S/Inputs/valid.yaml10 11 12; RUN: llvm-ctxprof-util fromYAML -input %S/Inputs/valid-ctx-only.yaml -output %t/valid-ctx-only.bitstream13; RUN: llvm-ctxprof-util toYAML -input %t/valid-ctx-only.bitstream -output %t/valid-ctx-only.yaml14; RUN: diff %t/valid-ctx-only.yaml %S/Inputs/valid-ctx-only.yaml15 16; RUN: llvm-ctxprof-util fromYAML -input %S/Inputs/valid-flat-only.yaml -output %t/valid-flat-only.bitstream17; RUN: llvm-ctxprof-util toYAML -input %t/valid-flat-only.bitstream -output %t/valid-flat-only.yaml18; RUN: diff %t/valid-flat-only.yaml %S/Inputs/valid-flat-only.yaml19 20; This case is the "valid.yaml" case but with the flat profile first.21; The output, though, should match valid.yaml22; RUN: llvm-ctxprof-util fromYAML -input %S/Inputs/valid-flat-first.yaml -output %t/valid-flat-first.bitstream23; RUN: llvm-ctxprof-util toYAML -input %t/valid-flat-first.bitstream -output %t/valid-flat-first.yaml24; RUN: diff %t/valid-flat-first.yaml %S/Inputs/valid.yaml25 26; A variant with unhandled contexts:27; RUN: llvm-ctxprof-util fromYAML -input %S/Inputs/valid-with-unhandled.yaml -output %t/valid-with-unhandled.bitstream28; RUN: llvm-ctxprof-util toYAML -input %t/valid-with-unhandled.bitstream -output %t/valid-with-unhandled.yaml29; RUN: diff %t/valid-with-unhandled.yaml %S/Inputs/valid-with-unhandled.yaml30 31; For the valid case, check against a reference output.32; Note that uint64_t are printed as signed values by llvm-bcanalyzer:33;  * 18446744073709551613 in yaml is -3 in the output34;  * 18446744073709551612 in yaml is -4 in the output35; Also we have no callee/context at index 0, 2 callsites for index 1, and one for36; index 2.37; RUN: llvm-bcanalyzer --dump %t/valid.bitstream | FileCheck %s --check-prefix=VALID38 39; EMPTY: <BLOCKINFO_BLOCK/>40; EMPTY-NEXT: <Metadata NumWords=1 BlockCodeSize=2>41; EMPTY-NEXT:   <Version op0=4/>42; EMPTY-NEXT: </Metadata>43 44; VALID:      <BLOCKINFO_BLOCK/>45; VALID-NEXT: <Metadata NumWords=53 BlockCodeSize=2>46; VALID-NEXT:   <Version op0=4/>47; VALID-NEXT:   <Contexts NumWords=37 BlockCodeSize=2>48; VALID-NEXT:     <Root NumWords=23 BlockCodeSize=2>49; VALID-NEXT:       <GUID op0=1000/>50; VALID-NEXT:       <TotalRootEntryCount op0=5/>51; VALID-NEXT:       <Counters op0=1 op1=2 op2=3/>52; VALID-NEXT:       <Unhandled NumWords=1 BlockCodeSize=2>53; VALID-NEXT:       </Unhandled>54; VALID-NEXT:       <Context NumWords=5 BlockCodeSize=2>55; VALID-NEXT:         <GUID op0=-3/>56; VALID-NEXT:         <CalleeIndex op0=1/>57; VALID-NEXT:         <Counters op0=6 op1=7 op2=8/>58; VALID-NEXT:       </Context>59; VALID-NEXT:       <Context NumWords=3 BlockCodeSize=2>60; VALID-NEXT:         <GUID op0=2000/>61; VALID-NEXT:         <CalleeIndex op0=1/>62; VALID-NEXT:         <Counters op0=4 op1=5/>63; VALID-NEXT:       </Context>64; VALID-NEXT:       <Context NumWords=3 BlockCodeSize=2>65; VALID-NEXT:         <GUID op0=3000/>66; VALID-NEXT:         <CalleeIndex op0=2/>67; VALID-NEXT:         <Counters op0=40 op1=50/>68; VALID-NEXT:       </Context>69; VALID-NEXT:     </Root>70; VALID-NEXT:     <Root NumWords=9 BlockCodeSize=2>71; VALID-NEXT:       <GUID op0=-4/>72; VALID-NEXT:       <TotalRootEntryCount op0=45/>73; VALID-NEXT:       <Counters op0=5 op1=9 op2=10/>74; VALID-NEXT:       <Unhandled NumWords=1 BlockCodeSize=2>75; VALID-NEXT:       </Unhandled>76; VALID-NEXT:     </Root>77; VALID-NEXT:   </Contexts>78; VALID-NEXT:   <FlatProfiles NumWords=10 BlockCodeSize=2>79; VALID-NEXT:       <Flat NumWords=3 BlockCodeSize=2>80; VALID-NEXT:         <GUID op0=1234/>81; VALID-NEXT:         <Counters op0=5 op1=6 op2=7/>82; VALID-NEXT:       </Flat>83; VALID-NEXT:       <Flat NumWords=2 BlockCodeSize=2>84; VALID-NEXT:         <GUID op0=5555/>85; VALID-NEXT:         <Counters op0=1/>86; VALID-NEXT:       </Flat>87; VALID-NEXT:   </FlatProfiles>88; VALID-NEXT: </Metadata>