Squashed 'third_party/llvm-7.0/llvm/' content from commit 65ce2e56889

git-subtree-dir: third_party/llvm-7.0/llvm
git-subtree-split: 65ce2e56889af84e8be8e311f484a4dfe4b62d7a
diff --git a/test/tools/llvm-profdata/Inputs/IR_profile.proftext b/test/tools/llvm-profdata/Inputs/IR_profile.proftext
new file mode 100644
index 0000000..7b7340e
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/IR_profile.proftext
@@ -0,0 +1,9 @@
+:ir
+main
+# Func Hash:
+12884901887
+# Num Counters:
+1
+# Counter Values:
+1
+
diff --git a/test/tools/llvm-profdata/Inputs/bad-hash.proftext b/test/tools/llvm-profdata/Inputs/bad-hash.proftext
new file mode 100644
index 0000000..faa6f40
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/bad-hash.proftext
@@ -0,0 +1,4 @@
+function_count_not
+badhash
+1
+1
diff --git a/test/tools/llvm-profdata/Inputs/bar3-1.proftext b/test/tools/llvm-profdata/Inputs/bar3-1.proftext
new file mode 100644
index 0000000..5486e9d
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/bar3-1.proftext
@@ -0,0 +1,6 @@
+bar
+3
+3
+1
+2
+3
diff --git a/test/tools/llvm-profdata/Inputs/basic.proftext b/test/tools/llvm-profdata/Inputs/basic.proftext
new file mode 100644
index 0000000..db934da
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/basic.proftext
@@ -0,0 +1,19 @@
+foo
+10
+2
+499500
+179900
+
+main
+16650
+4
+1
+1000
+1000000
+499500
+
+foo2
+10
+2
+500500
+180100
diff --git a/test/tools/llvm-profdata/Inputs/c-general.profraw b/test/tools/llvm-profdata/Inputs/c-general.profraw
new file mode 100644
index 0000000..332d11b
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/c-general.profraw
Binary files differ
diff --git a/test/tools/llvm-profdata/Inputs/clang_profile.proftext b/test/tools/llvm-profdata/Inputs/clang_profile.proftext
new file mode 100644
index 0000000..5419d23
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/clang_profile.proftext
@@ -0,0 +1,8 @@
+main
+# Func Hash:
+0
+# Num Counters:
+1
+# Counter Values:
+1
+
diff --git a/test/tools/llvm-profdata/Inputs/compat.profdata.v1 b/test/tools/llvm-profdata/Inputs/compat.profdata.v1
new file mode 100644
index 0000000..fd17459
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/compat.profdata.v1
Binary files differ
diff --git a/test/tools/llvm-profdata/Inputs/compat.profdata.v2 b/test/tools/llvm-profdata/Inputs/compat.profdata.v2
new file mode 100644
index 0000000..9698675
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/compat.profdata.v2
Binary files differ
diff --git a/test/tools/llvm-profdata/Inputs/compat.profdata.v4 b/test/tools/llvm-profdata/Inputs/compat.profdata.v4
new file mode 100644
index 0000000..7db0d1d
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/compat.profdata.v4
Binary files differ
diff --git a/test/tools/llvm-profdata/Inputs/compressed.profraw b/test/tools/llvm-profdata/Inputs/compressed.profraw
new file mode 100644
index 0000000..0cfaa07
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/compressed.profraw
Binary files differ
diff --git a/test/tools/llvm-profdata/Inputs/counter-mismatch-1.proftext b/test/tools/llvm-profdata/Inputs/counter-mismatch-1.proftext
new file mode 100644
index 0000000..45d028e
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/counter-mismatch-1.proftext
@@ -0,0 +1,13 @@
+foo
+1024
+1
+0
+
+foo
+1024
+5
+0
+0
+0
+0
+0
diff --git a/test/tools/llvm-profdata/Inputs/counter-mismatch-2.proftext b/test/tools/llvm-profdata/Inputs/counter-mismatch-2.proftext
new file mode 100644
index 0000000..261bfdd
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/counter-mismatch-2.proftext
@@ -0,0 +1,5 @@
+foo
+1024
+2
+0
+0
diff --git a/test/tools/llvm-profdata/Inputs/counter-mismatch-3.proftext b/test/tools/llvm-profdata/Inputs/counter-mismatch-3.proftext
new file mode 100644
index 0000000..ca70a71
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/counter-mismatch-3.proftext
@@ -0,0 +1,6 @@
+foo
+1024
+3
+0
+0
+0
diff --git a/test/tools/llvm-profdata/Inputs/counter-mismatch-4.proftext b/test/tools/llvm-profdata/Inputs/counter-mismatch-4.proftext
new file mode 100644
index 0000000..f403382
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/counter-mismatch-4.proftext
@@ -0,0 +1,7 @@
+foo
+1024
+4
+0
+0
+0
+0
diff --git a/test/tools/llvm-profdata/Inputs/empty.proftext b/test/tools/llvm-profdata/Inputs/empty.proftext
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/empty.proftext
diff --git a/test/tools/llvm-profdata/Inputs/extra-word.proftext b/test/tools/llvm-profdata/Inputs/extra-word.proftext
new file mode 100644
index 0000000..67a6629
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/extra-word.proftext
@@ -0,0 +1,2 @@
+extra 1 word
+1
diff --git a/test/tools/llvm-profdata/Inputs/foo3-1.proftext b/test/tools/llvm-profdata/Inputs/foo3-1.proftext
new file mode 100644
index 0000000..14a6200
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/foo3-1.proftext
@@ -0,0 +1,6 @@
+foo
+3
+3
+1
+2
+3
diff --git a/test/tools/llvm-profdata/Inputs/foo3-2.proftext b/test/tools/llvm-profdata/Inputs/foo3-2.proftext
new file mode 100644
index 0000000..801846e
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/foo3-2.proftext
@@ -0,0 +1,6 @@
+foo
+3
+3
+7
+5
+3
diff --git a/test/tools/llvm-profdata/Inputs/foo3bar3-1.proftext b/test/tools/llvm-profdata/Inputs/foo3bar3-1.proftext
new file mode 100644
index 0000000..12157b9
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/foo3bar3-1.proftext
@@ -0,0 +1,13 @@
+foo
+3
+3
+2
+3
+5
+
+bar
+3
+3
+7
+11
+13
diff --git a/test/tools/llvm-profdata/Inputs/gcc-sample-profile.gcov b/test/tools/llvm-profdata/Inputs/gcc-sample-profile.gcov
new file mode 100644
index 0000000..0099280
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/gcc-sample-profile.gcov
Binary files differ
diff --git a/test/tools/llvm-profdata/Inputs/inline-samples.afdo b/test/tools/llvm-profdata/Inputs/inline-samples.afdo
new file mode 100644
index 0000000..f8680d8
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/inline-samples.afdo
@@ -0,0 +1,20 @@
+main:366846:0
+ 2.1: 60401
+ 4: 0
+ 3: 0
+ 0: 0
+ 2.3: 60401
+ 1: 0
+ 2.3: _Z3fool:246044
+  1.2: 39280
+  1.4: 46871
+  1: 60401
+  1.3: _Z3bari:0
+   1.2: 0
+   1.1: 0
+  1.8: _Z3bari:0
+   1.2: 0
+   1.1: 0
+  1.7: _Z3bari:99492
+   1.2: 46732
+   1.1: 52760
diff --git a/test/tools/llvm-profdata/Inputs/invalid-count-later.proftext b/test/tools/llvm-profdata/Inputs/invalid-count-later.proftext
new file mode 100644
index 0000000..2b61c55
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/invalid-count-later.proftext
@@ -0,0 +1,4 @@
+invalid_count
+1
+1
+1later
diff --git a/test/tools/llvm-profdata/Inputs/multiple-profdata-merge.proftext b/test/tools/llvm-profdata/Inputs/multiple-profdata-merge.proftext
new file mode 100644
index 0000000..090a40f
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/multiple-profdata-merge.proftext
@@ -0,0 +1,106 @@
+# IR level Instrumentation Flag
+:ir
+foo
+# Func Hash:
+36982789018
+# Num Counters:
+4
+# Counter Values:
+700000
+700000
+0
+0
+
+foo
+# Func Hash:
+59188585735
+# Num Counters:
+6
+# Counter Values:
+400000
+400000
+0
+0
+0
+0
+
+foo
+# Func Hash:
+27904764724
+# Num Counters:
+3
+# Counter Values:
+200000
+200000
+0
+
+foo
+# Func Hash:
+60466382370
+# Num Counters:
+6
+# Counter Values:
+0
+100000
+0
+0
+0
+0
+
+bar
+# Func Hash:
+12884901887
+# Num Counters:
+1
+# Counter Values:
+0
+
+foo2
+# Func Hash:
+12884901887
+# Num Counters:
+1
+# Counter Values:
+0
+
+foo3
+# Func Hash:
+12884901887
+# Num Counters:
+1
+# Counter Values:
+0
+
+foo4
+# Func Hash:
+12884901887
+# Num Counters:
+1
+# Counter Values:
+0
+
+foo5
+# Func Hash:
+12884901887
+# Num Counters:
+1
+# Counter Values:
+0
+
+foo1
+# Func Hash:
+12884901887
+# Num Counters:
+1
+# Counter Values:
+100000
+
+main
+# Func Hash:
+29212902728
+# Num Counters:
+2
+# Counter Values:
+1400000
+14
+
diff --git a/test/tools/llvm-profdata/Inputs/no-counts.proftext b/test/tools/llvm-profdata/Inputs/no-counts.proftext
new file mode 100644
index 0000000..5c1fa15
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/no-counts.proftext
@@ -0,0 +1,3 @@
+no_counts
+0
+0
diff --git a/test/tools/llvm-profdata/Inputs/overflow-instr.proftext b/test/tools/llvm-profdata/Inputs/overflow-instr.proftext
new file mode 100644
index 0000000..48d1db8
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/overflow-instr.proftext
@@ -0,0 +1,6 @@
+overflow
+1
+3
+18446744073709551615
+9223372036854775808
+18446744073709551615
diff --git a/test/tools/llvm-profdata/Inputs/overflow-sample.proftext b/test/tools/llvm-profdata/Inputs/overflow-sample.proftext
new file mode 100644
index 0000000..a5486bb
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/overflow-sample.proftext
@@ -0,0 +1,7 @@
+_Z3bari:18446744073709551615:1000
+ 1: 18446744073709551615
+_Z3fooi:18446744073709551615:1000
+ 1: 18446744073709551615
+main:1000:0
+ 1: 500 _Z3bari:18446744073709551615
+ 2: 500 _Z3fooi:18446744073709551615
diff --git a/test/tools/llvm-profdata/Inputs/sample-profile.proftext b/test/tools/llvm-profdata/Inputs/sample-profile.proftext
new file mode 100644
index 0000000..e34128f
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/sample-profile.proftext
@@ -0,0 +1,16 @@
+_Z3bari:20301:1437
+ 1: 1437
+_Z3fooi:7711:610
+ 1: 610
+main:184019:0
+ 4: 534
+ 4.2: 534
+ 5: 1075
+ 5.1: 1075
+ 6: 2080
+ 7: 534
+ 9: 2064 _Z3bari:1471 _Z3fooi:631
+ 10: inline1:1000
+  1: 1000
+ 10: inline2:2000
+  1: 2000
diff --git a/test/tools/llvm-profdata/Inputs/text-format-errors.text.bin b/test/tools/llvm-profdata/Inputs/text-format-errors.text.bin
new file mode 100644
index 0000000..9e2e3f5
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/text-format-errors.text.bin
@@ -0,0 +1 @@
+ÿåбôɔ¨
\ No newline at end of file
diff --git a/test/tools/llvm-profdata/Inputs/vp-malform.proftext b/test/tools/llvm-profdata/Inputs/vp-malform.proftext
new file mode 100644
index 0000000..2db3096
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/vp-malform.proftext
@@ -0,0 +1,42 @@
+foo
+# Func Hash:
+10
+# Num Counters:
+2
+# Counter Values:
+999000
+359800
+
+foo2
+# Func Hash:
+10
+# Num Counters:
+2
+# Counter Values:
+1001000
+360200
+
+main
+# Func Hash:
+16650
+# Num Counters:
+4
+# Counter Values:
+2
+2000
+2000000
+999000
+# NumValueKinds
+1
+# Value Kind IPVK_IndirectCallTarget
+0
+# NumSites
+3
+# Values for each site
+0
+2
+# !!!! Malformed Value/Count pair
+foo+100
+foo2:1000
+1
+foo2:20000
diff --git a/test/tools/llvm-profdata/Inputs/vp-malform2.proftext b/test/tools/llvm-profdata/Inputs/vp-malform2.proftext
new file mode 100644
index 0000000..02ed5a9
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/vp-malform2.proftext
@@ -0,0 +1,32 @@
+foo
+# Func Hash:
+10
+# Num Counters:
+2
+# Counter Values:
+999000
+359800
+
+main
+# Func Hash:
+16650
+# Num Counters:
+4
+# Counter Values:
+2
+2000
+2000000
+999000
+# NumValueKinds
+1
+# Value Kind IPVK_IndirectCallTarget
+0
+# NumSites
+3
+# Values for each site
+0
+# !! Malformed value site, missing one value
+2
+foo:100
+1
+foo2:20000
diff --git a/test/tools/llvm-profdata/Inputs/vp-truncate.proftext b/test/tools/llvm-profdata/Inputs/vp-truncate.proftext
new file mode 100644
index 0000000..98b4b57
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/vp-truncate.proftext
@@ -0,0 +1,36 @@
+foo
+# Func Hash:
+10
+# Num Counters:
+2
+# Counter Values:
+999000
+359800
+
+foo2
+# Func Hash:
+10
+# Num Counters:
+2
+# Counter Values:
+1001000
+360200
+
+main
+# Func Hash:
+16650
+# Num Counters:
+4
+# Counter Values:
+2
+2000
+2000000
+999000
+# NumValueKinds
+1
+# Value Kind IPVK_IndirectCallTarget
+0
+# NumSites
+3
+# Values for each site
+0
diff --git a/test/tools/llvm-profdata/Inputs/weight-instr-bar.profdata b/test/tools/llvm-profdata/Inputs/weight-instr-bar.profdata
new file mode 100644
index 0000000..4ed0766
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/weight-instr-bar.profdata
Binary files differ
diff --git a/test/tools/llvm-profdata/Inputs/weight-instr-foo.profdata b/test/tools/llvm-profdata/Inputs/weight-instr-foo.profdata
new file mode 100644
index 0000000..581ef39
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/weight-instr-foo.profdata
Binary files differ
diff --git a/test/tools/llvm-profdata/Inputs/weight-sample-bar.proftext b/test/tools/llvm-profdata/Inputs/weight-sample-bar.proftext
new file mode 100644
index 0000000..a910f74
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/weight-sample-bar.proftext
@@ -0,0 +1,8 @@
+bar:1772037:35370
+ 17: 35370
+ 18: 35370
+ 19: 7005
+ 20: 29407
+ 21: 12170
+ 23: 18150 bar:19829
+ 25: 36666
diff --git a/test/tools/llvm-profdata/Inputs/weight-sample-foo.proftext b/test/tools/llvm-profdata/Inputs/weight-sample-foo.proftext
new file mode 100644
index 0000000..155ec5d
--- /dev/null
+++ b/test/tools/llvm-profdata/Inputs/weight-sample-foo.proftext
@@ -0,0 +1,8 @@
+foo:1763288:35327
+ 7: 35327
+ 8: 35327
+ 9: 6930
+ 10: 29341
+ 11: 11906
+ 13: 18185 foo:19531
+ 15: 36458