1 // build-fail
2 
3 #![feature(repr_simd, platform_intrinsics, core_intrinsics)]
4 #![allow(warnings)]
5 #![crate_type = "rlib"]
6 
7 // Bad monomorphizations could previously cause LLVM asserts even though the
8 // error was caught in the compiler.
9 
10 extern "platform-intrinsic" {
simd_add<T>(x: T, y: T) -> T11     fn simd_add<T>(x: T, y: T) -> T;
12 }
13 
14 use std::intrinsics;
15 
16 #[derive(Copy, Clone)]
17 pub struct Foo(i64);
18 
test_cttz(v: Foo) -> Foo19 pub fn test_cttz(v: Foo) -> Foo {
20     intrinsics::cttz(v)
21     //~^ ERROR `cttz` intrinsic: expected basic integer type, found `Foo`
22 }
23 
test_fadd_fast(a: Foo, b: Foo) -> Foo24 pub unsafe fn test_fadd_fast(a: Foo, b: Foo) -> Foo {
25     intrinsics::fadd_fast(a, b)
26     //~^ ERROR `fadd_fast` intrinsic: expected basic float type, found `Foo`
27 }
28 
test_simd_add(a: Foo, b: Foo) -> Foo29 pub unsafe fn test_simd_add(a: Foo, b: Foo) -> Foo {
30     simd_add(a, b)
31     //~^ ERROR `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo`
32 }
33