about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorgaurikholkar <f2013002@goa.bits-pilani.ac.in>2018-04-05 21:52:40 +0530
committergaurikholkar <f2013002@goa.bits-pilani.ac.in>2018-04-05 21:52:40 +0530
commit1b06fe1ef53775d8ff747528d429dc92054c20b2 (patch)
treefe6cb06792c90c44f0a4f5b3c8ec3d0ab914dfcb /src/test/codegen
parent6c649fbed4d4d86aed16dff8c0245b4871353cd1 (diff)
parent56714acc5eb0687ed9a7566fdebe5528657fc5b3 (diff)
downloadrust-1b06fe1ef53775d8ff747528d429dc92054c20b2.tar.gz
rust-1b06fe1ef53775d8ff747528d429dc92054c20b2.zip
Merge branch 'master' of https://github.com/rust-lang/rust into e0389
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/abi-main-signature-16bit-c-int.rs2
-rw-r--r--src/test/codegen/exact_div.rs30
-rw-r--r--src/test/codegen/fastcall-inreg.rs4
-rw-r--r--src/test/codegen/function-arguments.rs6
-rw-r--r--src/test/codegen/global_asm.rs4
-rw-r--r--src/test/codegen/global_asm_include.rs4
-rw-r--r--src/test/codegen/global_asm_x2.rs4
-rw-r--r--src/test/codegen/repeat-trusted-len.rs7
-rw-r--r--src/test/codegen/repr-transparent-aggregates-1.rs1
-rw-r--r--src/test/codegen/repr-transparent-aggregates-2.rs1
-rw-r--r--src/test/codegen/repr-transparent-aggregates-3.rs49
-rw-r--r--src/test/codegen/simd-intrinsic-float-minmax.rs43
-rw-r--r--src/test/codegen/simd-intrinsic-generic-select.rs35
-rw-r--r--src/test/codegen/stack-probes.rs4
-rw-r--r--src/test/codegen/unchecked-float-casts.rs1
-rw-r--r--src/test/codegen/x86_mmx.rs2
16 files changed, 186 insertions, 11 deletions
diff --git a/src/test/codegen/abi-main-signature-16bit-c-int.rs b/src/test/codegen/abi-main-signature-16bit-c-int.rs
index 1e02fe4befd..367d509cadf 100644
--- a/src/test/codegen/abi-main-signature-16bit-c-int.rs
+++ b/src/test/codegen/abi-main-signature-16bit-c-int.rs
@@ -17,7 +17,9 @@
 // ignore-asmjs
 // ignore-hexagon
 // ignore-mips
+// ignore-mips64
 // ignore-powerpc
+// ignore-powerpc64
 // ignore-s390x
 // ignore-sparc
 // ignore-wasm32
diff --git a/src/test/codegen/exact_div.rs b/src/test/codegen/exact_div.rs
new file mode 100644
index 00000000000..9ba6c0c0006
--- /dev/null
+++ b/src/test/codegen/exact_div.rs
@@ -0,0 +1,30 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -C no-prepopulate-passes
+
+#![crate_type = "lib"]
+#![feature(core_intrinsics)]
+
+use std::intrinsics::exact_div;
+
+// CHECK-LABEL: @exact_sdiv
+#[no_mangle]
+pub unsafe fn exact_sdiv(x: i32, y: i32) -> i32 {
+// CHECK: sdiv exact
+    exact_div(x, y)
+}
+
+// CHECK-LABEL: @exact_udiv
+#[no_mangle]
+pub unsafe fn exact_udiv(x: u32, y: u32) -> u32 {
+// CHECK: udiv exact
+    exact_div(x, y)
+}
diff --git a/src/test/codegen/fastcall-inreg.rs b/src/test/codegen/fastcall-inreg.rs
index b24899cc363..d6dd3f356b5 100644
--- a/src/test/codegen/fastcall-inreg.rs
+++ b/src/test/codegen/fastcall-inreg.rs
@@ -21,10 +21,10 @@
 // ignore-bpfeb
 // ignore-hexagon
 // ignore-mips
-// ignore-mipsel
 // ignore-mips64
-// ignore-mips64el
 // ignore-msp430
+// ignore-powerpc64
+// ignore-powerpc64le
 // ignore-powerpc
 // ignore-r600
 // ignore-amdgcn
diff --git a/src/test/codegen/function-arguments.rs b/src/test/codegen/function-arguments.rs
index 0e98d3f9050..de302c69056 100644
--- a/src/test/codegen/function-arguments.rs
+++ b/src/test/codegen/function-arguments.rs
@@ -133,6 +133,12 @@ pub fn trait_borrow(_: &Drop) {
 pub fn trait_box(_: Box<Drop>) {
 }
 
+// CHECK: { i8*, i8* } @trait_option(i8* noalias %x.0, i8* %x.1)
+#[no_mangle]
+pub fn trait_option(x: Option<Box<Drop>>) -> Option<Box<Drop>> {
+  x
+}
+
 // CHECK: { [0 x i16]*, [[USIZE]] } @return_slice([0 x i16]* noalias nonnull readonly %x.0, [[USIZE]] %x.1)
 #[no_mangle]
 pub fn return_slice(x: &[u16]) -> &[u16] {
diff --git a/src/test/codegen/global_asm.rs b/src/test/codegen/global_asm.rs
index 5661592d0c7..6b79e79fa00 100644
--- a/src/test/codegen/global_asm.rs
+++ b/src/test/codegen/global_asm.rs
@@ -17,10 +17,10 @@
 // ignore-bpfeb
 // ignore-hexagon
 // ignore-mips
-// ignore-mipsel
 // ignore-mips64
-// ignore-mips64el
 // ignore-msp430
+// ignore-powerpc64
+// ignore-powerpc64le
 // ignore-powerpc
 // ignore-r600
 // ignore-amdgcn
diff --git a/src/test/codegen/global_asm_include.rs b/src/test/codegen/global_asm_include.rs
index d8b5db12404..3f73a1cabbf 100644
--- a/src/test/codegen/global_asm_include.rs
+++ b/src/test/codegen/global_asm_include.rs
@@ -17,10 +17,10 @@
 // ignore-bpfeb
 // ignore-hexagon
 // ignore-mips
-// ignore-mipsel
 // ignore-mips64
-// ignore-mips64el
 // ignore-msp430
+// ignore-powerpc64
+// ignore-powerpc64le
 // ignore-powerpc
 // ignore-r600
 // ignore-amdgcn
diff --git a/src/test/codegen/global_asm_x2.rs b/src/test/codegen/global_asm_x2.rs
index caa0506550d..3e118a50d45 100644
--- a/src/test/codegen/global_asm_x2.rs
+++ b/src/test/codegen/global_asm_x2.rs
@@ -17,10 +17,10 @@
 // ignore-bpfeb
 // ignore-hexagon
 // ignore-mips
-// ignore-mipsel
 // ignore-mips64
-// ignore-mips64el
 // ignore-msp430
+// ignore-powerpc64
+// ignore-powerpc64le
 // ignore-powerpc
 // ignore-r600
 // ignore-amdgcn
diff --git a/src/test/codegen/repeat-trusted-len.rs b/src/test/codegen/repeat-trusted-len.rs
index 43872f15d51..8b3294281e9 100644
--- a/src/test/codegen/repeat-trusted-len.rs
+++ b/src/test/codegen/repeat-trusted-len.rs
@@ -15,9 +15,14 @@
 
 use std::iter;
 
+// CHECK: @helper([[USIZE:i[0-9]+]] %arg0)
+#[no_mangle]
+pub fn helper(_: usize) {
+}
+
 // CHECK-LABEL: @repeat_take_collect
 #[no_mangle]
 pub fn repeat_take_collect() -> Vec<u8> {
-// CHECK: call void @llvm.memset.p0i8
+// CHECK: call void @llvm.memset.p0i8.[[USIZE]](i8* {{(nonnull )?}}%{{[0-9]+}}, i8 42, [[USIZE]] 100000, i32 1, i1 false)
     iter::repeat(42).take(100000).collect()
 }
diff --git a/src/test/codegen/repr-transparent-aggregates-1.rs b/src/test/codegen/repr-transparent-aggregates-1.rs
index 655e67cf7ee..2eeed2b788c 100644
--- a/src/test/codegen/repr-transparent-aggregates-1.rs
+++ b/src/test/codegen/repr-transparent-aggregates-1.rs
@@ -14,6 +14,7 @@
 // ignore-mips
 // ignore-mips64
 // ignore-powerpc
+// ignore-powerpc64
 // See repr-transparent.rs
 
 #![crate_type="lib"]
diff --git a/src/test/codegen/repr-transparent-aggregates-2.rs b/src/test/codegen/repr-transparent-aggregates-2.rs
index e6374928a5c..9605ded569e 100644
--- a/src/test/codegen/repr-transparent-aggregates-2.rs
+++ b/src/test/codegen/repr-transparent-aggregates-2.rs
@@ -12,6 +12,7 @@
 
 // ignore-aarch64
 // ignore-asmjs
+// ignore-mips64
 // ignore-s390x
 // ignore-wasm
 // ignore-x86
diff --git a/src/test/codegen/repr-transparent-aggregates-3.rs b/src/test/codegen/repr-transparent-aggregates-3.rs
new file mode 100644
index 00000000000..0c90239c9de
--- /dev/null
+++ b/src/test/codegen/repr-transparent-aggregates-3.rs
@@ -0,0 +1,49 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -C no-prepopulate-passes
+
+// only-mips64
+// See repr-transparent.rs
+
+#![crate_type="lib"]
+#![feature(repr_transparent)]
+
+
+#[repr(C)]
+pub struct Big([u32; 16]);
+
+#[repr(transparent)]
+pub struct BigW(Big);
+
+// CHECK: define void @test_Big(%Big* [[BIG_RET_ATTRS:.*]], [8 x i64]
+#[no_mangle]
+pub extern fn test_Big(_: Big) -> Big { loop {} }
+
+// CHECK: define void @test_BigW(%BigW* [[BIG_RET_ATTRS]], [8 x i64]
+#[no_mangle]
+pub extern fn test_BigW(_: BigW) -> BigW { loop {} }
+
+
+#[repr(C)]
+pub union BigU {
+    foo: [u32; 16],
+}
+
+#[repr(transparent)]
+pub struct BigUw(BigU);
+
+// CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS:.*]], [8 x i64]
+#[no_mangle]
+pub extern fn test_BigU(_: BigU) -> BigU { loop {} }
+
+// CHECK: define void @test_BigUw(%BigUw* [[BIGU_RET_ATTRS]], [8 x i64]
+#[no_mangle]
+pub extern fn test_BigUw(_: BigUw) -> BigUw { loop {} }
diff --git a/src/test/codegen/simd-intrinsic-float-minmax.rs b/src/test/codegen/simd-intrinsic-float-minmax.rs
new file mode 100644
index 00000000000..6663b841808
--- /dev/null
+++ b/src/test/codegen/simd-intrinsic-float-minmax.rs
@@ -0,0 +1,43 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// ignore-emscripten
+// min-llvm-version 6.0
+
+// compile-flags: -C no-prepopulate-passes
+
+#![crate_type = "lib"]
+
+#![feature(repr_simd, platform_intrinsics)]
+#[allow(non_camel_case_types)]
+
+#[repr(simd)]
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
+
+extern "platform-intrinsic" {
+    fn simd_fmin<T>(x: T, y: T) -> T;
+    fn simd_fmax<T>(x: T, y: T) -> T;
+}
+
+// CHECK-LABEL: @fmin
+#[no_mangle]
+pub unsafe fn fmin(a: f32x4, b: f32x4) -> f32x4 {
+    // CHECK: call <4 x float> @llvm.minnum.v4f32
+    simd_fmin(a, b)
+}
+
+// FIXME(49261)
+// // C_HECK-LABEL: @fmax
+// #[no_mangle]
+// pub unsafe fn fmax(a: f32x4, b: f32x4) -> f32x4 {
+// // C_HECK: call <4 x float> @llvm.maxnum.v4f32
+//     simd_fmax(a, b)
+// }
diff --git a/src/test/codegen/simd-intrinsic-generic-select.rs b/src/test/codegen/simd-intrinsic-generic-select.rs
new file mode 100644
index 00000000000..8a64d7437d8
--- /dev/null
+++ b/src/test/codegen/simd-intrinsic-generic-select.rs
@@ -0,0 +1,35 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -C no-prepopulate-passes
+
+#![crate_type = "lib"]
+
+#![feature(repr_simd, platform_intrinsics)]
+#[allow(non_camel_case_types)]
+
+#[repr(simd)]
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
+
+#[repr(simd)]
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub struct b8x4(pub i8, pub i8, pub i8, pub i8);
+
+extern "platform-intrinsic" {
+    fn simd_select<T, U>(x: T, a: U, b: U) -> U;
+}
+
+// CHECK-LABEL: @select
+#[no_mangle]
+pub unsafe fn select(m: b8x4, a: f32x4, b: f32x4) -> f32x4 {
+    // CHECK: select <4 x i1>
+    simd_select(m, a, b)
+}
diff --git a/src/test/codegen/stack-probes.rs b/src/test/codegen/stack-probes.rs
index 4a489f1edb3..51ebc42a0dd 100644
--- a/src/test/codegen/stack-probes.rs
+++ b/src/test/codegen/stack-probes.rs
@@ -10,8 +10,10 @@
 
 // ignore-arm
 // ignore-aarch64
+// ignore-mips
+// ignore-mips64
 // ignore-powerpc
-// ignore-aarch64
+// ignore-s390x
 // ignore-wasm
 // ignore-emscripten
 // ignore-windows
diff --git a/src/test/codegen/unchecked-float-casts.rs b/src/test/codegen/unchecked-float-casts.rs
index c2fc2966170..87ebaaeec32 100644
--- a/src/test/codegen/unchecked-float-casts.rs
+++ b/src/test/codegen/unchecked-float-casts.rs
@@ -14,7 +14,6 @@
 // -Z saturating-float-casts is not enabled.
 
 #![crate_type = "lib"]
-#![feature(i128_type)]
 
 // CHECK-LABEL: @f32_to_u32
 #[no_mangle]
diff --git a/src/test/codegen/x86_mmx.rs b/src/test/codegen/x86_mmx.rs
index dc9f63c35db..30777c6214e 100644
--- a/src/test/codegen/x86_mmx.rs
+++ b/src/test/codegen/x86_mmx.rs
@@ -11,6 +11,8 @@
 // ignore-arm
 // ignore-aarch64
 // ignore-emscripten
+// ignore-mips
+// ignore-mips64
 // compile-flags: -O
 
 #![feature(repr_simd)]