blob: 05de2e38af1ff9584605fdde567eeeee00f969ce [file] [log] [blame]
Nathan Slingerland4f823662015-11-13 03:47:58 +00001Tests for instrumentation profile bad encoding.
2
31- Detect invalid count
Justin Bogneraf3001e2014-07-30 23:02:01 +00004RUN: not llvm-profdata show %p/Inputs/invalid-count-later.proftext 2>&1 | FileCheck %s --check-prefix=INVALID-COUNT-LATER
Nathan Slingerland7f5b47d2015-12-15 17:37:09 +00005RUN: not llvm-profdata merge %p/Inputs/invalid-count-later.proftext %p/Inputs/invalid-count-later.proftext -o %t.out 2>&1 | FileCheck %s --check-prefix=INVALID-COUNT-LATER
Nathan Slingerland4f823662015-11-13 03:47:58 +00006INVALID-COUNT-LATER: error: {{.*}}invalid-count-later.proftext: Malformed instrumentation profile data
Justin Bognerec49f982014-03-12 22:00:57 +00007
Nathan Slingerland4f823662015-11-13 03:47:58 +000082- Detect bad hash
Justin Bogneraf3001e2014-07-30 23:02:01 +00009RUN: not llvm-profdata show %p/Inputs/bad-hash.proftext 2>&1 | FileCheck %s --check-prefix=BAD-HASH
10RUN: not llvm-profdata merge %p/Inputs/bad-hash.proftext %p/Inputs/bad-hash.proftext -o %t.out 2>&1 | FileCheck %s --check-prefix=BAD-HASH
Nathan Slingerland4f823662015-11-13 03:47:58 +000011BAD-HASH: error: {{.*}}bad-hash.proftext: Malformed instrumentation profile data
Justin Bognerb59d7c72014-04-25 02:45:33 +000012
Nathan Slingerland4f823662015-11-13 03:47:58 +0000133- Detect no counts
Justin Bogneraf3001e2014-07-30 23:02:01 +000014RUN: not llvm-profdata show %p/Inputs/no-counts.proftext 2>&1 | FileCheck %s --check-prefix=NO-COUNTS
Nathan Slingerland4f823662015-11-13 03:47:58 +000015NO-COUNTS: error: {{.*}}no-counts.proftext: Malformed instrumentation profile data
16
174- Detect binary input
NAKAMURA Takumi7706fe52015-11-13 06:06:58 +000018RUN: not llvm-profdata show %p/Inputs/text-format-errors.text.bin 2>&1 | FileCheck %s --check-prefix=BINARY
Nathan Slingerland4f823662015-11-13 03:47:58 +000019BINARY: error: {{.+}}: Unrecognized instrumentation profile encoding format
20BINARY: Perhaps you forgot to use the -sample option?
Xinliang David Lie3bf4fd32015-12-14 18:44:01 +000021
225- Detect malformed value profile data
23RUN: not llvm-profdata show %p/Inputs/vp-malform.proftext 2>&1 | FileCheck %s --check-prefix=VP
24RUN: not llvm-profdata show %p/Inputs/vp-malform2.proftext 2>&1 | FileCheck %s --check-prefix=VP
25VP: Malformed instrumentation profile data
26
276- Detect truncated value profile data
28RUN: not llvm-profdata show %p/Inputs/vp-truncate.proftext 2>&1 | FileCheck %s --check-prefix=VPTRUNC
29VPTRUNC: Truncated profile data