File tree Expand file tree Collapse file tree 5 files changed +73
-45
lines changed Expand file tree Collapse file tree 5 files changed +73
-45
lines changed Original file line number Diff line number Diff line change
1
+ // This test verifies the accuracy of emitted file and line debuginfo metadata for closures and
2
+ // generators.
3
+ //
4
+ // compile-flags: -C debuginfo=2
5
+ #![ crate_type = "lib" ]
6
+ #![ feature( generators) ]
7
+
8
+ // CHECK: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}/codegen/issue-98678-closure-generator.rs{{".*}})
9
+
10
+ pub fn foo ( ) {
11
+ // CHECK: !DICompositeType({{.*"[{]}}closure_env#0{{[}]".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
12
+ let closure = |x| x;
13
+ closure ( 0 ) ;
14
+
15
+ // CHECK: !DICompositeType({{.*"[{]}}generator_env#1{{[}]".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
16
+ let generator = || yield 1 ;
17
+ }
Original file line number Diff line number Diff line change
1
+ // This test verifies the accuracy of emitted file and line debuginfo metadata for C++-like
2
+ // enumerations.
3
+ //
4
+ // compile-flags: -C debuginfo=2
5
+ #![ crate_type = "lib" ]
6
+
7
+ // The use of CHECK-DAG here is because the C++-like enum is emitted before the `DIFile` node
8
+
9
+ // CHECK-DAG: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}/codegen/issue-98678-cpp-like-enum.rs{{".*}})
10
+
11
+ // CHECK-DAG: !DICompositeType({{.*"}}MyCppLikeEnum{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]],
12
+ #[ repr( C ) ]
13
+ pub enum MyCppLikeEnum {
14
+ One ,
15
+ }
16
+
17
+ pub fn foo ( _: MyCppLikeEnum ) { }
Original file line number Diff line number Diff line change
1
+ // This test verifies the accuracy of emitted file and line debuginfo metadata for native
2
+ // enumerations.
3
+ //
4
+ // compile-flags: -C debuginfo=2
5
+ #![ crate_type = "lib" ]
6
+
7
+ // CHECK: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}/codegen/issue-98678-native-enum.rs{{".*}})
8
+
9
+ // CHECK: !DICompositeType({{.*"}}MyNativeEnum{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 2]],
10
+ // CHECK: !DICompositeType({{.*}}DW_TAG_variant_part{{.*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
11
+ pub enum MyNativeEnum {
12
+ // CHECK: !DIDerivedType({{.*"}}One{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
13
+ One ,
14
+ }
15
+
16
+ pub fn foo ( _: MyNativeEnum ) { }
Original file line number Diff line number Diff line change
1
+ // This test verifies the accuracy of emitted file and line debuginfo metadata for structs and
2
+ // unions.
3
+ //
4
+ // compile-flags: -C debuginfo=2
5
+ #![ crate_type = "lib" ]
6
+
7
+ // CHECK: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}/codegen/issue-98678-struct-union.rs{{".*}})
8
+
9
+ // CHECK: !DICompositeType({{.*"}}MyType{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
10
+ pub struct MyType {
11
+ // CHECK: !DIDerivedType({{.*"}}i{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
12
+ i : i32 ,
13
+ }
14
+
15
+ // CHECK: !DICompositeType({{.*"}}MyUnion{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
16
+ pub union MyUnion {
17
+ // CHECK: !DIDerivedType({{.*"}}i{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
18
+ i : i32 ,
19
+ // CHECK: !DIDerivedType({{.*"}}f{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
20
+ f : f32 ,
21
+ }
22
+
23
+ pub fn foo ( _: MyType , _: MyUnion ) { }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments