summaryrefslogtreecommitdiff
path: root/user/rust/0008-Correct-minimum-system-LLVM-version-in-tests.patch
blob: 1da2bec5c3a74c91f79c0babe0fa75943c94a48f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
From b038aa4b514a520c3ad2a6ab0e518cb8d45c4ca0 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 22 Mar 2019 17:08:06 -0500
Subject: [PATCH 08/14] Correct minimum system LLVM version in tests

Since commit 9452a8dfa3ba, the new debug info format is only generated
for LLVM 8 and newer versions. However, the tests still assume that LLVM
7 will use the new debug info format. Fix the tests (and a comment in
the code) to match the actual version check.
---
 src/librustc_codegen_llvm/debuginfo/metadata.rs           | 8 +++++---
 src/test/codegen/enum-debug-clike.rs                      | 2 +-
 src/test/codegen/enum-debug-niche-2.rs                    | 2 +-
 src/test/codegen/enum-debug-niche.rs                      | 2 +-
 src/test/codegen/enum-debug-tagged.rs                     | 2 +-
 src/test/debuginfo/borrowed-enum.rs                       | 2 +-
 .../debuginfo/generic-enum-with-different-disr-sizes.rs   | 2 +-
 src/test/debuginfo/generic-struct-style-enum.rs           | 2 +-
 src/test/debuginfo/generic-tuple-style-enum.rs            | 2 +-
 src/test/debuginfo/recursive-struct.rs                    | 2 +-
 src/test/debuginfo/struct-style-enum.rs                   | 2 +-
 src/test/debuginfo/tuple-style-enum.rs                    | 2 +-
 src/test/debuginfo/unique-enum.rs                         | 2 +-
 13 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs
index ddcbf29da8..8efa025e3d 100644
--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs
+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs
@@ -1156,12 +1156,14 @@ fn prepare_union_metadata(
 // Enums
 //=-----------------------------------------------------------------------------
 
-// DWARF variant support is only available starting in LLVM 7.
+// DWARF variant support is only available starting in LLVM 8.
 // Although the earlier enum debug info output did not work properly
 // in all situations, it is better for the time being to continue to
 // sometimes emit the old style rather than emit something completely
-// useless when rust is compiled against LLVM 6 or older.  This
-// function decides which representation will be emitted.
+// useless when rust is compiled against LLVM 6 or older. LLVM 7
+// contains an early version of the DWARF variant support, and will
+// crash when handling the new debug info format. This function
+// decides which representation will be emitted.
 fn use_enum_fallback(cx: &CodegenCx<'_, '_>) -> bool {
     // On MSVC we have to use the fallback mode, because LLVM doesn't
     // lower variant parts to PDB.
diff --git a/src/test/codegen/enum-debug-clike.rs b/src/test/codegen/enum-debug-clike.rs
index 62cfef5a84..f268c8bcbc 100644
--- a/src/test/codegen/enum-debug-clike.rs
+++ b/src/test/codegen/enum-debug-clike.rs
@@ -4,7 +4,7 @@
 
 // ignore-tidy-linelength
 // ignore-windows
-// min-system-llvm-version 7.0
+// min-system-llvm-version 8.0
 
 // compile-flags: -g -C no-prepopulate-passes
 
diff --git a/src/test/codegen/enum-debug-niche-2.rs b/src/test/codegen/enum-debug-niche-2.rs
index 369fa1fcfd..aa6cbf66b4 100644
--- a/src/test/codegen/enum-debug-niche-2.rs
+++ b/src/test/codegen/enum-debug-niche-2.rs
@@ -4,7 +4,7 @@
 
 // ignore-tidy-linelength
 // ignore-windows
-// min-system-llvm-version 7.0
+// min-system-llvm-version 8.0
 
 // compile-flags: -g -C no-prepopulate-passes
 
diff --git a/src/test/codegen/enum-debug-niche.rs b/src/test/codegen/enum-debug-niche.rs
index 1273a785ba..93eebde7b8 100644
--- a/src/test/codegen/enum-debug-niche.rs
+++ b/src/test/codegen/enum-debug-niche.rs
@@ -4,7 +4,7 @@
 
 // ignore-tidy-linelength
 // ignore-windows
-// min-system-llvm-version 7.0
+// min-system-llvm-version 8.0
 
 // compile-flags: -g -C no-prepopulate-passes
 
diff --git a/src/test/codegen/enum-debug-tagged.rs b/src/test/codegen/enum-debug-tagged.rs
index 5c37e40c27..84976ce97a 100644
--- a/src/test/codegen/enum-debug-tagged.rs
+++ b/src/test/codegen/enum-debug-tagged.rs
@@ -4,7 +4,7 @@
 
 // ignore-tidy-linelength
 // ignore-windows
-// min-system-llvm-version 7.0
+// min-system-llvm-version 8.0
 
 // compile-flags: -g -C no-prepopulate-passes
 
diff --git a/src/test/debuginfo/borrowed-enum.rs b/src/test/debuginfo/borrowed-enum.rs
index e27a31dd0e..63c11f59c1 100644
--- a/src/test/debuginfo/borrowed-enum.rs
+++ b/src/test/debuginfo/borrowed-enum.rs
@@ -1,7 +1,7 @@
 // ignore-tidy-linelength
 
 // Require LLVM with DW_TAG_variant_part and a gdb or lldb that can read it.
-// min-system-llvm-version: 7.0
+// min-system-llvm-version: 8.0
 // min-gdb-version: 8.2
 // rust-lldb
 
diff --git a/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs b/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs
index 9392aa7097..e26294cb73 100644
--- a/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs
+++ b/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs
@@ -3,7 +3,7 @@
 // min-lldb-version: 310
 
 // Require LLVM with DW_TAG_variant_part and a gdb that can read it.
-// min-system-llvm-version: 7.0
+// min-system-llvm-version: 8.0
 // min-gdb-version: 8.2
 
 // compile-flags:-g
diff --git a/src/test/debuginfo/generic-struct-style-enum.rs b/src/test/debuginfo/generic-struct-style-enum.rs
index 3e59347030..3dc5cb807b 100644
--- a/src/test/debuginfo/generic-struct-style-enum.rs
+++ b/src/test/debuginfo/generic-struct-style-enum.rs
@@ -2,7 +2,7 @@
 // min-lldb-version: 310
 
 // Require LLVM with DW_TAG_variant_part and a gdb that can read it.
-// min-system-llvm-version: 7.0
+// min-system-llvm-version: 8.0
 // min-gdb-version: 8.2
 
 // compile-flags:-g
diff --git a/src/test/debuginfo/generic-tuple-style-enum.rs b/src/test/debuginfo/generic-tuple-style-enum.rs
index 3c136add07..b16634ee6d 100644
--- a/src/test/debuginfo/generic-tuple-style-enum.rs
+++ b/src/test/debuginfo/generic-tuple-style-enum.rs
@@ -2,7 +2,7 @@
 
 // Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
 // read it.
-// min-system-llvm-version: 7.0
+// min-system-llvm-version: 8.0
 // min-gdb-version: 8.2
 // rust-lldb
 
diff --git a/src/test/debuginfo/recursive-struct.rs b/src/test/debuginfo/recursive-struct.rs
index c3d2bea913..8fb83b7956 100644
--- a/src/test/debuginfo/recursive-struct.rs
+++ b/src/test/debuginfo/recursive-struct.rs
@@ -2,7 +2,7 @@
 // ignore-lldb
 
 // Require LLVM with DW_TAG_variant_part and a gdb that can read it.
-// min-system-llvm-version: 7.0
+// min-system-llvm-version: 8.0
 // min-gdb-version: 8.2
 
 // compile-flags:-g
diff --git a/src/test/debuginfo/struct-style-enum.rs b/src/test/debuginfo/struct-style-enum.rs
index 1654c93209..5843b076b1 100644
--- a/src/test/debuginfo/struct-style-enum.rs
+++ b/src/test/debuginfo/struct-style-enum.rs
@@ -2,7 +2,7 @@
 
 // Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
 // read it.
-// min-system-llvm-version: 7.0
+// min-system-llvm-version: 8.0
 // min-gdb-version: 8.2
 // rust-lldb
 
diff --git a/src/test/debuginfo/tuple-style-enum.rs b/src/test/debuginfo/tuple-style-enum.rs
index fd76bcb0af..4d9727a388 100644
--- a/src/test/debuginfo/tuple-style-enum.rs
+++ b/src/test/debuginfo/tuple-style-enum.rs
@@ -2,7 +2,7 @@
 
 // Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
 // read it.
-// min-system-llvm-version: 7.0
+// min-system-llvm-version: 8.0
 // min-gdb-version: 8.2
 // rust-lldb
 
diff --git a/src/test/debuginfo/unique-enum.rs b/src/test/debuginfo/unique-enum.rs
index da0d06213e..32bd93f1ed 100644
--- a/src/test/debuginfo/unique-enum.rs
+++ b/src/test/debuginfo/unique-enum.rs
@@ -2,7 +2,7 @@
 
 // Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
 // read it.
-// min-system-llvm-version: 7.0
+// min-system-llvm-version: 8.0
 // min-gdb-version: 8.2
 // rust-lldb
 
-- 
2.21.0