@@ -19,36 +19,36 @@ pub struct F32(f32);
1919
2020// CHECK: define float @test_F32(float %_1)
2121#[ no_mangle]
22- pub extern fn test_F32 ( _: F32 ) -> F32 { loop { } }
22+ pub extern "C" fn test_F32 ( _: F32 ) -> F32 { loop { } }
2323
2424#[ repr( transparent) ]
2525pub struct Ptr ( * mut u8 ) ;
2626
2727// CHECK: define i8* @test_Ptr(i8* %_1)
2828#[ no_mangle]
29- pub extern fn test_Ptr ( _: Ptr ) -> Ptr { loop { } }
29+ pub extern "C" fn test_Ptr ( _: Ptr ) -> Ptr { loop { } }
3030
3131#[ repr( transparent) ]
3232pub struct WithZst ( u64 , Zst1 ) ;
3333
3434// CHECK: define i64 @test_WithZst(i64 %_1)
3535#[ no_mangle]
36- pub extern fn test_WithZst ( _: WithZst ) -> WithZst { loop { } }
36+ pub extern "C" fn test_WithZst ( _: WithZst ) -> WithZst { loop { } }
3737
3838#[ repr( transparent) ]
3939pub struct WithZeroSizedArray ( * const f32 , [ i8 ; 0 ] ) ;
4040
4141// Apparently we use i32* when newtype-unwrapping f32 pointers. Whatever.
4242// CHECK: define i32* @test_WithZeroSizedArray(i32* %_1)
4343#[ no_mangle]
44- pub extern fn test_WithZeroSizedArray ( _: WithZeroSizedArray ) -> WithZeroSizedArray { loop { } }
44+ pub extern "C" fn test_WithZeroSizedArray ( _: WithZeroSizedArray ) -> WithZeroSizedArray { loop { } }
4545
4646#[ repr( transparent) ]
4747pub struct Generic < T > ( T ) ;
4848
4949// CHECK: define double @test_Generic(double %_1)
5050#[ no_mangle]
51- pub extern fn test_Generic ( _: Generic < f64 > ) -> Generic < f64 > { loop { } }
51+ pub extern "C" fn test_Generic ( _: Generic < f64 > ) -> Generic < f64 > { loop { } }
5252
5353#[ repr( transparent) ]
5454pub struct GenericPlusZst < T > ( T , Zst2 ) ;
@@ -58,14 +58,14 @@ pub enum Bool { True, False, FileNotFound }
5858
5959// CHECK: define{{( zeroext)?}} i8 @test_Gpz(i8{{( zeroext)?}} %_1)
6060#[ no_mangle]
61- pub extern fn test_Gpz ( _: GenericPlusZst < Bool > ) -> GenericPlusZst < Bool > { loop { } }
61+ pub extern "C" fn test_Gpz ( _: GenericPlusZst < Bool > ) -> GenericPlusZst < Bool > { loop { } }
6262
6363#[ repr( transparent) ]
6464pub struct LifetimePhantom < ' a , T : ' a > ( * const T , PhantomData < & ' a T > ) ;
6565
6666// CHECK: define i16* @test_LifetimePhantom(i16* %_1)
6767#[ no_mangle]
68- pub extern fn test_LifetimePhantom ( _: LifetimePhantom < i16 > ) -> LifetimePhantom < i16 > { loop { } }
68+ pub extern "C" fn test_LifetimePhantom ( _: LifetimePhantom < i16 > ) -> LifetimePhantom < i16 > { loop { } }
6969
7070// This works despite current alignment resrictions because PhantomData is always align(1)
7171#[ repr( transparent) ]
@@ -75,28 +75,28 @@ pub struct Px;
7575
7676// CHECK: define float @test_UnitPhantom(float %_1)
7777#[ no_mangle]
78- pub extern fn test_UnitPhantom ( _: UnitPhantom < f32 , Px > ) -> UnitPhantom < f32 , Px > { loop { } }
78+ pub extern "C" fn test_UnitPhantom ( _: UnitPhantom < f32 , Px > ) -> UnitPhantom < f32 , Px > { loop { } }
7979
8080#[ repr( transparent) ]
8181pub struct TwoZsts ( Zst1 , i8 , Zst2 ) ;
8282
8383// CHECK: define{{( signext)?}} i8 @test_TwoZsts(i8{{( signext)?}} %_1)
8484#[ no_mangle]
85- pub extern fn test_TwoZsts ( _: TwoZsts ) -> TwoZsts { loop { } }
85+ pub extern "C" fn test_TwoZsts ( _: TwoZsts ) -> TwoZsts { loop { } }
8686
8787#[ repr( transparent) ]
8888pub struct Nested1 ( Zst2 , Generic < f64 > ) ;
8989
9090// CHECK: define double @test_Nested1(double %_1)
9191#[ no_mangle]
92- pub extern fn test_Nested1 ( _: Nested1 ) -> Nested1 { loop { } }
92+ pub extern "C" fn test_Nested1 ( _: Nested1 ) -> Nested1 { loop { } }
9393
9494#[ repr( transparent) ]
9595pub struct Nested2 ( Nested1 , Zst1 ) ;
9696
9797// CHECK: define double @test_Nested2(double %_1)
9898#[ no_mangle]
99- pub extern fn test_Nested2 ( _: Nested2 ) -> Nested2 { loop { } }
99+ pub extern "C" fn test_Nested2 ( _: Nested2 ) -> Nested2 { loop { } }
100100
101101#[ repr( simd) ]
102102struct f32x4 ( f32 , f32 , f32 , f32 ) ;
@@ -106,7 +106,7 @@ pub struct Vector(f32x4);
106106
107107// CHECK: define <4 x float> @test_Vector(<4 x float> %_1)
108108#[ no_mangle]
109- pub extern fn test_Vector ( _: Vector ) -> Vector { loop { } }
109+ pub extern "C" fn test_Vector ( _: Vector ) -> Vector { loop { } }
110110
111111trait Mirror { type It : ?Sized ; }
112112impl < T : ?Sized > Mirror for T { type It = Self ; }
@@ -116,7 +116,7 @@ pub struct StructWithProjection(<f32 as Mirror>::It);
116116
117117// CHECK: define float @test_Projection(float %_1)
118118#[ no_mangle]
119- pub extern fn test_Projection ( _: StructWithProjection ) -> StructWithProjection { loop { } }
119+ pub extern "C" fn test_Projection ( _: StructWithProjection ) -> StructWithProjection { loop { } }
120120
121121#[ repr( transparent) ]
122122pub enum EnumF32 {
@@ -125,7 +125,7 @@ pub enum EnumF32 {
125125
126126// CHECK: define float @test_EnumF32(float %_1)
127127#[ no_mangle]
128- pub extern fn test_EnumF32 ( _: EnumF32 ) -> EnumF32 { loop { } }
128+ pub extern "C" fn test_EnumF32 ( _: EnumF32 ) -> EnumF32 { loop { } }
129129
130130#[ repr( transparent) ]
131131pub enum EnumF32WithZsts {
@@ -134,7 +134,7 @@ pub enum EnumF32WithZsts {
134134
135135// CHECK: define float @test_EnumF32WithZsts(float %_1)
136136#[ no_mangle]
137- pub extern fn test_EnumF32WithZsts ( _: EnumF32WithZsts ) -> EnumF32WithZsts { loop { } }
137+ pub extern "C" fn test_EnumF32WithZsts ( _: EnumF32WithZsts ) -> EnumF32WithZsts { loop { } }
138138
139139#[ repr( transparent) ]
140140pub union UnionF32 {
@@ -143,7 +143,7 @@ pub union UnionF32 {
143143
144144// CHECK: define float @test_UnionF32(float %_1)
145145#[ no_mangle]
146- pub extern fn test_UnionF32 ( _: UnionF32 ) -> UnionF32 { loop { } }
146+ pub extern "C" fn test_UnionF32 ( _: UnionF32 ) -> UnionF32 { loop { } }
147147
148148#[ repr( transparent) ]
149149pub union UnionF32WithZsts {
@@ -154,7 +154,7 @@ pub union UnionF32WithZsts {
154154
155155// CHECK: define float @test_UnionF32WithZsts(float %_1)
156156#[ no_mangle]
157- pub extern fn test_UnionF32WithZsts ( _: UnionF32WithZsts ) -> UnionF32WithZsts { loop { } }
157+ pub extern "C" fn test_UnionF32WithZsts ( _: UnionF32WithZsts ) -> UnionF32WithZsts { loop { } }
158158
159159
160160// All that remains to be tested are aggregates. They are tested in separate files called repr-
0 commit comments