Skip to content

Commit 9fd4be9

Browse files
Update codegen tests.
1 parent cedae73 commit 9fd4be9

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

src/test/codegen/adjustments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// Hack to get the correct size for the length part in slices
1616
// CHECK: @helper([[USIZE:i[0-9]+]] %arg0)
1717
#[no_mangle]
18-
fn helper(_: usize) {
18+
pub fn helper(_: usize) {
1919
}
2020

2121
// CHECK-LABEL: @no_op_slice_adjustment

src/test/codegen/function-arguments.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,20 @@ pub fn struct_return() -> S {
9393
// Hack to get the correct size for the length part in slices
9494
// CHECK: @helper([[USIZE:i[0-9]+]] %arg0)
9595
#[no_mangle]
96-
fn helper(_: usize) {
96+
pub fn helper(_: usize) {
9797
}
9898

9999
// CHECK: @slice(i8* noalias nonnull readonly %arg0.ptr, [[USIZE]] %arg0.meta)
100100
// FIXME #25759 This should also have `nocapture`
101101
#[no_mangle]
102-
fn slice(_: &[u8]) {
102+
pub fn slice(_: &[u8]) {
103103
}
104104

105105
// CHECK: @mutable_slice(i8* nonnull %arg0.ptr, [[USIZE]] %arg0.meta)
106106
// FIXME #25759 This should also have `nocapture`
107107
// ... there's this LLVM bug that forces us to not use noalias, see #29485
108108
#[no_mangle]
109-
fn mutable_slice(_: &mut [u8]) {
109+
pub fn mutable_slice(_: &mut [u8]) {
110110
}
111111

112112
// CHECK: @unsafe_slice(%UnsafeInner* nonnull %arg0.ptr, [[USIZE]] %arg0.meta)
@@ -118,23 +118,23 @@ pub fn unsafe_slice(_: &[UnsafeInner]) {
118118
// CHECK: @str(i8* noalias nonnull readonly %arg0.ptr, [[USIZE]] %arg0.meta)
119119
// FIXME #25759 This should also have `nocapture`
120120
#[no_mangle]
121-
fn str(_: &[u8]) {
121+
pub fn str(_: &[u8]) {
122122
}
123123

124124
// CHECK: @trait_borrow({}* nonnull, {}* noalias nonnull readonly)
125125
// FIXME #25759 This should also have `nocapture`
126126
#[no_mangle]
127-
fn trait_borrow(_: &Drop) {
127+
pub fn trait_borrow(_: &Drop) {
128128
}
129129

130130
// CHECK: @trait_box({}* noalias nonnull, {}* noalias nonnull readonly)
131131
#[no_mangle]
132-
fn trait_box(_: Box<Drop>) {
132+
pub fn trait_box(_: Box<Drop>) {
133133
}
134134

135135
// CHECK: { i16*, [[USIZE]] } @return_slice(i16* noalias nonnull readonly %x.ptr, [[USIZE]] %x.meta)
136136
#[no_mangle]
137-
fn return_slice(x: &[u16]) -> &[u16] {
137+
pub fn return_slice(x: &[u16]) -> &[u16] {
138138
x
139139
}
140140

src/test/codegen/mir_zst_stores.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct Zst { phantom: PhantomData<Zst> }
1919
// CHECK-LABEL: @mir
2020
// CHECK-NOT: store{{.*}}undef
2121
#[no_mangle]
22-
fn mir() {
22+
pub fn mir() {
2323
let x = Zst { phantom: PhantomData };
2424
let y = (x, 0);
2525
drop(y);

src/test/codegen/naked-functions.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,40 @@
1616
#![feature(naked_functions)]
1717

1818
// CHECK: Function Attrs: naked uwtable
19-
// CHECK-NEXT: define internal void @naked_empty()
19+
// CHECK-NEXT: define void @naked_empty()
2020
#[no_mangle]
2121
#[naked]
22-
fn naked_empty() {
22+
pub fn naked_empty() {
2323
// CHECK-NEXT: {{.+}}:
2424
// CHECK-NEXT: ret void
2525
}
2626

2727
// CHECK: Function Attrs: naked uwtable
2828
#[no_mangle]
2929
#[naked]
30-
// CHECK-NEXT: define internal void @naked_with_args(i{{[0-9]+}})
31-
fn naked_with_args(a: isize) {
30+
// CHECK-NEXT: define void @naked_with_args(i{{[0-9]+}})
31+
pub fn naked_with_args(a: isize) {
3232
// CHECK-NEXT: {{.+}}:
3333
// CHECK-NEXT: %a = alloca i{{[0-9]+}}
3434
&a; // keep variable in an alloca
3535
// CHECK: ret void
3636
}
3737

3838
// CHECK: Function Attrs: naked uwtable
39-
// CHECK-NEXT: define internal i{{[0-9]+}} @naked_with_return()
39+
// CHECK-NEXT: define i{{[0-9]+}} @naked_with_return()
4040
#[no_mangle]
4141
#[naked]
42-
fn naked_with_return() -> isize {
42+
pub fn naked_with_return() -> isize {
4343
// CHECK-NEXT: {{.+}}:
4444
// CHECK-NEXT: ret i{{[0-9]+}} 0
4545
0
4646
}
4747

4848
// CHECK: Function Attrs: naked uwtable
49-
// CHECK-NEXT: define internal i{{[0-9]+}} @naked_with_args_and_return(i{{[0-9]+}})
49+
// CHECK-NEXT: define i{{[0-9]+}} @naked_with_args_and_return(i{{[0-9]+}})
5050
#[no_mangle]
5151
#[naked]
52-
fn naked_with_args_and_return(a: isize) -> isize {
52+
pub fn naked_with_args_and_return(a: isize) -> isize {
5353
// CHECK-NEXT: {{.+}}:
5454
// CHECK-NEXT: %a = alloca i{{[0-9]+}}
5555
&a; // keep variable in an alloca
@@ -58,10 +58,10 @@ fn naked_with_args_and_return(a: isize) -> isize {
5858
}
5959

6060
// CHECK: Function Attrs: naked uwtable
61-
// CHECK-NEXT: define internal void @naked_recursive()
61+
// CHECK-NEXT: define void @naked_recursive()
6262
#[no_mangle]
6363
#[naked]
64-
fn naked_recursive() {
64+
pub fn naked_recursive() {
6565
// CHECK-NEXT: {{.+}}:
6666
// CHECK-NEXT: call void @naked_empty()
6767

src/test/codegen/refs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// Hack to get the correct size for the length part in slices
1616
// CHECK: @helper([[USIZE:i[0-9]+]] %arg0)
1717
#[no_mangle]
18-
fn helper(_: usize) {
18+
pub fn helper(_: usize) {
1919
}
2020

2121
// CHECK-LABEL: @ref_dst

0 commit comments

Comments
 (0)