blob: c8500bfac769f93115679dbd8886c87c11868c7d [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
5RUN: not llvm-profdata merge %p/Inputs/invalid-count-later.proftext %p/Inputs/invalid-count-later.profdata -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?