about summary refs log tree commit diff
path: root/tests/codegen/enum/enum-debug-clike.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-08-07 05:29:11 +0200
committerGitHub <noreply@github.com>2023-08-07 05:29:11 +0200
commitfe1c3a1a5e6afa5e8d342e5313aa3952bad30625 (patch)
treed778de75adf1b93a1a816fb0dc9d02a8360d281f /tests/codegen/enum/enum-debug-clike.rs
parent137177386b1d2c991a6f34bc0be57b5f4224159c (diff)
parentc81d3e23d1aa58571ce82de0af916cc7f3c9a1be (diff)
Rollup merge of #114230 - workingjubilee:codegen-tests-that-nest, r=Mark-Simulacrum
Nest other codegen test topics

This PR is like rust-lang/rust#114229 in that it mostly pushes codegen tests around, shoving them into their own directories, but because all of the changes are very simple cleanups I pulled them into a separate PR. The other PR might involve actually evaluating the correctness of the test after changes, but here it is mostly a matter of taste. The only "functional" change is deleting a few tests that... hinge on a version of LLVM that we don't support (as of rust-lang/rust#114148 anyways).

I considered a few different ways to group other topics but I feel the question of whether `tests/codegen/{vec,array,slice}` should exist is more subtle than these choices, as it might be better to group such related tests by other topics like bounds check elision, thus I avoided making it.
Diffstat (limited to 'tests/codegen/enum/enum-debug-clike.rs')
-rw-r--r--tests/codegen/enum/enum-debug-clike.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/codegen/enum/enum-debug-clike.rs b/tests/codegen/enum/enum-debug-clike.rs
new file mode 100644
index 00000000000..1e369a2c4e6
--- /dev/null
+++ b/tests/codegen/enum/enum-debug-clike.rs
@@ -0,0 +1,23 @@
+// This tests that debug info for "c-like" enums is properly emitted.
+// This is ignored for the fallback mode on MSVC due to problems with PDB.
+
+//
+// ignore-msvc
+
+// compile-flags: -g -C no-prepopulate-passes
+
+// CHECK-LABEL: @main
+// CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_enumeration_type,{{.*}}name: "E",{{.*}}flags: DIFlagEnumClass,{{.*}}
+// CHECK: {{.*}}DIEnumerator{{.*}}name: "A",{{.*}}value: {{[0-9].*}}
+// CHECK: {{.*}}DIEnumerator{{.*}}name: "B",{{.*}}value: {{[0-9].*}}
+// CHECK: {{.*}}DIEnumerator{{.*}}name: "C",{{.*}}value: {{[0-9].*}}
+
+#![allow(dead_code)]
+#![allow(unused_variables)]
+#![allow(unused_assignments)]
+
+enum E { A, B, C }
+
+pub fn main() {
+    let e = E::C;
+}