[llvm-profdata] Add check for text profile formats and improve error reporting
[oota-llvm.git] / test / tools / llvm-profdata / sample-profile-basic.test
index 0651c513e9655f7606d70f153c37961ab00a7161..9981d4204c430ae4c467619f560f106f049c4814 100644 (file)
@@ -28,3 +28,7 @@ RUN: llvm-profdata merge --sample --text %p/Inputs/sample-profile.proftext %t-bi
 MERGE1: main:368038:0
 MERGE1: 9: 4128 _Z3fooi:1262 _Z3bari:2942
 MERGE1: _Z3fooi:15422:1220
+
+5- Detect invalid text encoding (e.g. instrumentation profile text format).
+RUN: not llvm-profdata show --sample %p/Inputs/foo3bar3-1.proftext 2>&1 | FileCheck %s --check-prefix=BADTEXT
+BADTEXT: error: {{.+}}: Unrecognized sample profile encoding format