Skip to content

Commit fb806fd

Browse files
committed
test: fix repr-transparent-aggregates test on mips64
Since #47964 was merged, 64-bit mips started passing all structures using 64-bit chunks regardless of their contents. The repr-transparent-aggregates tests needs updating to cope with this.
1 parent 54467ae commit fb806fd

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

src/test/codegen/repr-transparent-aggregates-2.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
// ignore-aarch64
1414
// ignore-asmjs
15+
// ignore-mips64
1516
// ignore-s390x
1617
// ignore-wasm
1718
// ignore-x86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags: -C no-prepopulate-passes
12+
13+
// only-mips64
14+
// See repr-transparent.rs
15+
16+
#![crate_type="lib"]
17+
#![feature(repr_transparent)]
18+
19+
20+
#[repr(C)]
21+
pub struct Big([u32; 16]);
22+
23+
#[repr(transparent)]
24+
pub struct BigW(Big);
25+
26+
// CHECK: define void @test_Big(%Big* [[BIG_RET_ATTRS:.*]], [8 x i64]
27+
#[no_mangle]
28+
pub extern fn test_Big(_: Big) -> Big { loop {} }
29+
30+
// CHECK: define void @test_BigW(%BigW* [[BIG_RET_ATTRS]], [8 x i64]
31+
#[no_mangle]
32+
pub extern fn test_BigW(_: BigW) -> BigW { loop {} }
33+
34+
35+
#[repr(C)]
36+
pub union BigU {
37+
foo: [u32; 16],
38+
}
39+
40+
#[repr(transparent)]
41+
pub struct BigUw(BigU);
42+
43+
// CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS:.*]], [8 x i64]
44+
#[no_mangle]
45+
pub extern fn test_BigU(_: BigU) -> BigU { loop {} }
46+
47+
// CHECK: define void @test_BigUw(%BigUw* [[BIGU_RET_ATTRS]], [8 x i64]
48+
#[no_mangle]
49+
pub extern fn test_BigUw(_: BigUw) -> BigUw { loop {} }

0 commit comments

Comments
 (0)