4
4
//@ needs-sanitizer-cfi
5
5
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6
6
7
- #![ crate_type= "lib" ]
7
+ #![ crate_type = "lib" ]
8
8
#![ feature( type_alias_impl_trait) ]
9
9
10
10
extern crate core;
@@ -14,14 +14,15 @@ pub type Type2 = impl Send;
14
14
pub type Type3 = impl Send ;
15
15
pub type Type4 = impl Send ;
16
16
17
- pub fn foo ( ) where
17
+ pub fn foo ( )
18
+ where
18
19
Type1 : ' static ,
19
20
Type2 : ' static ,
20
21
Type3 : ' static ,
21
22
Type4 : ' static ,
22
23
{
23
24
// Type in extern path
24
- extern {
25
+ extern "C" {
25
26
fn bar ( ) ;
26
27
}
27
28
let _: Type1 = bar;
@@ -35,43 +36,44 @@ pub fn foo() where
35
36
// Type in const path
36
37
const {
37
38
pub struct Foo ;
38
- fn bar ( ) -> Type3 { Foo }
39
+ fn bar ( ) -> Type3 {
40
+ Foo
41
+ }
39
42
} ;
40
43
41
-
42
44
// Type in impl path
43
45
struct Foo ;
44
46
impl Foo {
45
- fn bar ( & self ) { }
47
+ fn bar ( & self ) { }
46
48
}
47
49
let _: Type4 = <Foo >:: bar;
48
50
}
49
51
50
52
// Force arguments to be passed by using a reference. Otherwise, they may end up PassMode::Ignore
51
53
52
- pub fn foo1 ( _: & Type1 ) { }
54
+ pub fn foo1 ( _: & Type1 ) { }
53
55
// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
54
- pub fn foo2 ( _: & Type1 , _: & Type1 ) { }
56
+ pub fn foo2 ( _: & Type1 , _: & Type1 ) { }
55
57
// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
56
- pub fn foo3 ( _: & Type1 , _: & Type1 , _: & Type1 ) { }
58
+ pub fn foo3 ( _: & Type1 , _: & Type1 , _: & Type1 ) { }
57
59
// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
58
- pub fn foo4 ( _: & Type2 ) { }
60
+ pub fn foo4 ( _: & Type2 ) { }
59
61
// CHECK: define{{.*}}4foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
60
- pub fn foo5 ( _: & Type2 , _: & Type2 ) { }
62
+ pub fn foo5 ( _: & Type2 , _: & Type2 ) { }
61
63
// CHECK: define{{.*}}4foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
62
- pub fn foo6 ( _: & Type2 , _: & Type2 , _: & Type2 ) { }
64
+ pub fn foo6 ( _: & Type2 , _: & Type2 , _: & Type2 ) { }
63
65
// CHECK: define{{.*}}4foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
64
- pub fn foo7 ( _: & Type3 ) { }
66
+ pub fn foo7 ( _: & Type3 ) { }
65
67
// CHECK: define{{.*}}4foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
66
- pub fn foo8 ( _: & Type3 , _: & Type3 ) { }
68
+ pub fn foo8 ( _: & Type3 , _: & Type3 ) { }
67
69
// CHECK: define{{.*}}4foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
68
- pub fn foo9 ( _: & Type3 , _: & Type3 , _: & Type3 ) { }
70
+ pub fn foo9 ( _: & Type3 , _: & Type3 , _: & Type3 ) { }
69
71
// CHECK: define{{.*}}4foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
70
- pub fn foo10 ( _: & Type4 ) { }
72
+ pub fn foo10 ( _: & Type4 ) { }
71
73
// CHECK: define{{.*}}5foo10{{.*}}!type ![[TYPE10:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
72
- pub fn foo11 ( _: & Type4 , _: & Type4 ) { }
74
+ pub fn foo11 ( _: & Type4 , _: & Type4 ) { }
73
75
// CHECK: define{{.*}}5foo11{{.*}}!type ![[TYPE11:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
74
- pub fn foo12 ( _: & Type4 , _: & Type4 , _: & Type4 ) { }
76
+ pub fn foo12 ( _: & Type4 , _: & Type4 , _: & Type4 ) { }
75
77
// CHECK: define{{.*}}5foo12{{.*}}!type ![[TYPE12:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
76
78
77
79
// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NvNFNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo10{{[{}][{}]}}extern{{[}][}]}}3barEE"}
@@ -80,9 +82,9 @@ pub fn foo12(_: &Type4, _: &Type4, _: &Type4) { }
80
82
// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNCNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo11{{[{}][{}]}}closure{{[}][}]}}3FooEE"}
81
83
// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNCNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo11{{[{}][{}]}}closure{{[}][}]}}3FooES0_E"}
82
84
// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNCNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo11{{[{}][{}]}}closure{{[}][}]}}3FooES0_S0_E"}
83
- // CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNkNvC {{[[:print:]]+}}_{{[[:print:]]+}}3foo12{{[{}][{}]}}constant{{[}][}]}}3FooEE "}
84
- // CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNkNvC {{[[:print:]]+}}_{{[[:print:]]+}}3foo12{{[{}][{}]}}constant{{[}][}]}}3FooES0_E "}
85
- // CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNkNvC {{[[:print:]]+}}_{{[[:print:]]+}}3foo12{{[{}][{}]}}constant{{[}][}]}}3FooES0_S0_E "}
85
+ // CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNvC {{[[:print:]]+}}_{{[[:print:]]+}}3foo3FooEE "}
86
+ // CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNvC {{[[:print:]]+}}_{{[[:print:]]+}}3foo3FooES0_E "}
87
+ // CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNvC {{[[:print:]]+}}_{{[[:print:]]+}}3foo3FooES0_S0_E "}
86
88
// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NvNINvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo8{{[{}][{}]}}impl{{[}][}]}}3barEE"}
87
89
// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NvNINvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo8{{[{}][{}]}}impl{{[}][}]}}3barES0_E"}
88
90
// CHECK: ![[TYPE12]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NvNINvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo8{{[{}][{}]}}impl{{[}][}]}}3barES0_S0_E"}
0 commit comments