summaryrefslogtreecommitdiffstats
path: root/tests/codegen/debug-accessibility/super-enum.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen/debug-accessibility/super-enum.rs')
-rw-r--r--tests/codegen/debug-accessibility/super-enum.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/codegen/debug-accessibility/super-enum.rs b/tests/codegen/debug-accessibility/super-enum.rs
new file mode 100644
index 000000000..9d83fb45b
--- /dev/null
+++ b/tests/codegen/debug-accessibility/super-enum.rs
@@ -0,0 +1,27 @@
+// compile-flags: -C debuginfo=2
+// ignore-tidy-linelength
+
+#![allow(dead_code)]
+
+// Checks that visibility information is present in the debuginfo for super-visibility enums.
+
+mod module {
+ use std::hint::black_box;
+
+ pub(super) enum SuperFooEnum {
+ A,
+ B(u32),
+ C { x: u32 },
+ }
+
+ // NONMSVC: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "SuperFooEnum"{{.*}}flags: DIFlagProtected{{.*}})
+ // MSVC: {{!.*}} = !DICompositeType(tag: DW_TAG_union_type, name: "enum2$<super_enum::module::SuperFooEnum>"{{.*}}flags: DIFlagProtected{{.*}})
+
+ pub fn use_everything() {
+ black_box(SuperFooEnum::A);
+ }
+}
+
+fn main() {
+ module::use_everything();
+}