summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/SampleProfile/Inputs/inline.extbinary.afdobin0 -> 272 bytes
-rw-r--r--llvm/test/Transforms/SampleProfile/profile-format.ll (renamed from llvm/test/Transforms/SampleProfile/compact-binary-profile.ll)6
-rw-r--r--llvm/test/tools/llvm-profdata/roundtrip.test11
3 files changed, 14 insertions, 3 deletions
diff --git a/llvm/test/Transforms/SampleProfile/Inputs/inline.extbinary.afdo b/llvm/test/Transforms/SampleProfile/Inputs/inline.extbinary.afdo
new file mode 100644
index 00000000000..f1a1f87820f
--- /dev/null
+++ b/llvm/test/Transforms/SampleProfile/Inputs/inline.extbinary.afdo
Binary files differ
diff --git a/llvm/test/Transforms/SampleProfile/compact-binary-profile.ll b/llvm/test/Transforms/SampleProfile/profile-format.ll
index 3b0a2a47c31..4f7ae0a06a4 100644
--- a/llvm/test/Transforms/SampleProfile/compact-binary-profile.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-format.ll
@@ -2,6 +2,8 @@
; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline.prof -S | FileCheck %s
; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.compactbinary.afdo -S | FileCheck %s
; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline.compactbinary.afdo -S | FileCheck %s
+; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.extbinary.afdo -S | FileCheck %s
+; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline.extbinary.afdo -S | FileCheck %s
; Original C++ test case
;
@@ -21,8 +23,8 @@
;
@.str = private unnamed_addr constant [11 x i8] c"sum is %d\0A\00", align 1
-; Check sample-profile phase using compactbinary format profile will annotate
-; the IR with exactly the same result as using text format.
+; Check sample-profile phase using compactbinary or extbinary format profile
+; will annotate the IR with exactly the same result as using text format.
; CHECK: br i1 %cmp, label %while.body, label %while.end{{.*}} !prof ![[IDX1:[0-9]*]]
; CHECK: br i1 %cmp1, label %if.then, label %if.else{{.*}} !prof ![[IDX2:[0-9]*]]
; CHECK: call i32 (i8*, ...) @printf{{.*}} !prof ![[IDX3:[0-9]*]]
diff --git a/llvm/test/tools/llvm-profdata/roundtrip.test b/llvm/test/tools/llvm-profdata/roundtrip.test
index 00abc40b87e..d5469be56fe 100644
--- a/llvm/test/tools/llvm-profdata/roundtrip.test
+++ b/llvm/test/tools/llvm-profdata/roundtrip.test
@@ -6,4 +6,13 @@ RUN: llvm-profdata show -o %t.1.proftext -all-functions -text %t.1.profdata
RUN: diff %t.1.proftext %S/Inputs/IR_profile.proftext
RUN: llvm-profdata merge --sample --binary -output=%t.2.profdata %S/Inputs/sample-profile.proftext
RUN: llvm-profdata merge --sample --text -output=%t.2.proftext %t.2.profdata
-RUN: diff %t.2.proftext %S/Inputs/sample-profile.proftext \ No newline at end of file
+RUN: diff %t.2.proftext %S/Inputs/sample-profile.proftext
+# Round trip from text --> extbinary --> text
+RUN: llvm-profdata merge --sample --extbinary -output=%t.3.profdata %S/Inputs/sample-profile.proftext
+RUN: llvm-profdata merge --sample --text -output=%t.3.proftext %t.3.profdata
+RUN: diff %t.3.proftext %S/Inputs/sample-profile.proftext
+# Round trip from text --> binary --> extbinary --> text
+RUN: llvm-profdata merge --sample --binary -output=%t.4.profdata %S/Inputs/sample-profile.proftext
+RUN: llvm-profdata merge --sample --extbinary -output=%t.5.profdata %t.4.profdata
+RUN: llvm-profdata merge --sample --text -output=%t.4.proftext %t.5.profdata
+RUN: diff %t.4.proftext %S/Inputs/sample-profile.proftext
OpenPOWER on IntegriCloud