Update codegen tests.
This commit is contained in:
parent
cedae73c8c
commit
9fd4be9c2e
@ -15,7 +15,7 @@
|
||||
// Hack to get the correct size for the length part in slices
|
||||
// CHECK: @helper([[USIZE:i[0-9]+]] %arg0)
|
||||
#[no_mangle]
|
||||
fn helper(_: usize) {
|
||||
pub fn helper(_: usize) {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: @no_op_slice_adjustment
|
||||
|
@ -93,20 +93,20 @@ pub fn struct_return() -> S {
|
||||
// Hack to get the correct size for the length part in slices
|
||||
// CHECK: @helper([[USIZE:i[0-9]+]] %arg0)
|
||||
#[no_mangle]
|
||||
fn helper(_: usize) {
|
||||
pub fn helper(_: usize) {
|
||||
}
|
||||
|
||||
// CHECK: @slice(i8* noalias nonnull readonly %arg0.ptr, [[USIZE]] %arg0.meta)
|
||||
// FIXME #25759 This should also have `nocapture`
|
||||
#[no_mangle]
|
||||
fn slice(_: &[u8]) {
|
||||
pub fn slice(_: &[u8]) {
|
||||
}
|
||||
|
||||
// CHECK: @mutable_slice(i8* nonnull %arg0.ptr, [[USIZE]] %arg0.meta)
|
||||
// FIXME #25759 This should also have `nocapture`
|
||||
// ... there's this LLVM bug that forces us to not use noalias, see #29485
|
||||
#[no_mangle]
|
||||
fn mutable_slice(_: &mut [u8]) {
|
||||
pub fn mutable_slice(_: &mut [u8]) {
|
||||
}
|
||||
|
||||
// CHECK: @unsafe_slice(%UnsafeInner* nonnull %arg0.ptr, [[USIZE]] %arg0.meta)
|
||||
@ -118,23 +118,23 @@ pub fn unsafe_slice(_: &[UnsafeInner]) {
|
||||
// CHECK: @str(i8* noalias nonnull readonly %arg0.ptr, [[USIZE]] %arg0.meta)
|
||||
// FIXME #25759 This should also have `nocapture`
|
||||
#[no_mangle]
|
||||
fn str(_: &[u8]) {
|
||||
pub fn str(_: &[u8]) {
|
||||
}
|
||||
|
||||
// CHECK: @trait_borrow({}* nonnull, {}* noalias nonnull readonly)
|
||||
// FIXME #25759 This should also have `nocapture`
|
||||
#[no_mangle]
|
||||
fn trait_borrow(_: &Drop) {
|
||||
pub fn trait_borrow(_: &Drop) {
|
||||
}
|
||||
|
||||
// CHECK: @trait_box({}* noalias nonnull, {}* noalias nonnull readonly)
|
||||
#[no_mangle]
|
||||
fn trait_box(_: Box<Drop>) {
|
||||
pub fn trait_box(_: Box<Drop>) {
|
||||
}
|
||||
|
||||
// CHECK: { i16*, [[USIZE]] } @return_slice(i16* noalias nonnull readonly %x.ptr, [[USIZE]] %x.meta)
|
||||
#[no_mangle]
|
||||
fn return_slice(x: &[u16]) -> &[u16] {
|
||||
pub fn return_slice(x: &[u16]) -> &[u16] {
|
||||
x
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ struct Zst { phantom: PhantomData<Zst> }
|
||||
// CHECK-LABEL: @mir
|
||||
// CHECK-NOT: store{{.*}}undef
|
||||
#[no_mangle]
|
||||
fn mir() {
|
||||
pub fn mir() {
|
||||
let x = Zst { phantom: PhantomData };
|
||||
let y = (x, 0);
|
||||
drop(y);
|
||||
|
@ -16,10 +16,10 @@
|
||||
#![feature(naked_functions)]
|
||||
|
||||
// CHECK: Function Attrs: naked uwtable
|
||||
// CHECK-NEXT: define internal void @naked_empty()
|
||||
// CHECK-NEXT: define void @naked_empty()
|
||||
#[no_mangle]
|
||||
#[naked]
|
||||
fn naked_empty() {
|
||||
pub fn naked_empty() {
|
||||
// CHECK-NEXT: {{.+}}:
|
||||
// CHECK-NEXT: ret void
|
||||
}
|
||||
@ -27,8 +27,8 @@ fn naked_empty() {
|
||||
// CHECK: Function Attrs: naked uwtable
|
||||
#[no_mangle]
|
||||
#[naked]
|
||||
// CHECK-NEXT: define internal void @naked_with_args(i{{[0-9]+}})
|
||||
fn naked_with_args(a: isize) {
|
||||
// CHECK-NEXT: define void @naked_with_args(i{{[0-9]+}})
|
||||
pub fn naked_with_args(a: isize) {
|
||||
// CHECK-NEXT: {{.+}}:
|
||||
// CHECK-NEXT: %a = alloca i{{[0-9]+}}
|
||||
&a; // keep variable in an alloca
|
||||
@ -36,20 +36,20 @@ fn naked_with_args(a: isize) {
|
||||
}
|
||||
|
||||
// CHECK: Function Attrs: naked uwtable
|
||||
// CHECK-NEXT: define internal i{{[0-9]+}} @naked_with_return()
|
||||
// CHECK-NEXT: define i{{[0-9]+}} @naked_with_return()
|
||||
#[no_mangle]
|
||||
#[naked]
|
||||
fn naked_with_return() -> isize {
|
||||
pub fn naked_with_return() -> isize {
|
||||
// CHECK-NEXT: {{.+}}:
|
||||
// CHECK-NEXT: ret i{{[0-9]+}} 0
|
||||
0
|
||||
}
|
||||
|
||||
// CHECK: Function Attrs: naked uwtable
|
||||
// CHECK-NEXT: define internal i{{[0-9]+}} @naked_with_args_and_return(i{{[0-9]+}})
|
||||
// CHECK-NEXT: define i{{[0-9]+}} @naked_with_args_and_return(i{{[0-9]+}})
|
||||
#[no_mangle]
|
||||
#[naked]
|
||||
fn naked_with_args_and_return(a: isize) -> isize {
|
||||
pub fn naked_with_args_and_return(a: isize) -> isize {
|
||||
// CHECK-NEXT: {{.+}}:
|
||||
// CHECK-NEXT: %a = alloca i{{[0-9]+}}
|
||||
&a; // keep variable in an alloca
|
||||
@ -58,10 +58,10 @@ fn naked_with_args_and_return(a: isize) -> isize {
|
||||
}
|
||||
|
||||
// CHECK: Function Attrs: naked uwtable
|
||||
// CHECK-NEXT: define internal void @naked_recursive()
|
||||
// CHECK-NEXT: define void @naked_recursive()
|
||||
#[no_mangle]
|
||||
#[naked]
|
||||
fn naked_recursive() {
|
||||
pub fn naked_recursive() {
|
||||
// CHECK-NEXT: {{.+}}:
|
||||
// CHECK-NEXT: call void @naked_empty()
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
// Hack to get the correct size for the length part in slices
|
||||
// CHECK: @helper([[USIZE:i[0-9]+]] %arg0)
|
||||
#[no_mangle]
|
||||
fn helper(_: usize) {
|
||||
pub fn helper(_: usize) {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: @ref_dst
|
||||
|
Loading…
Reference in New Issue
Block a user