1
1
//@ only-x86_64
2
- //@ build-pass
3
- //@ ignore-pass (test emits codegen-time warnings)
2
+ //@ build-fail
4
3
//@ compile-flags: -C target-feature=-avx
5
4
6
5
#![ feature( avx512_target_feature) ]
@@ -14,20 +13,17 @@ use std::arch::x86_64::*;
14
13
struct Wrapper ( __m256 ) ;
15
14
16
15
unsafe extern "C" fn w ( _: Wrapper ) {
17
- //~^ requires the `avx` target feature, which is not enabled
18
- //~| WARNING this was previously accepted by the compiler
16
+ //~^ ERROR: requires the `avx` target feature, which is not enabled
19
17
todo ! ( )
20
18
}
21
19
22
20
unsafe extern "C" fn f ( _: __m256 ) {
23
- //~^ requires the `avx` target feature, which is not enabled
24
- //~| WARNING this was previously accepted by the compiler
21
+ //~^ ERROR: requires the `avx` target feature, which is not enabled
25
22
todo ! ( )
26
23
}
27
24
28
25
unsafe extern "C" fn g ( ) -> __m256 {
29
- //~^ requires the `avx` target feature, which is not enabled
30
- //~| WARNING this was previously accepted by the compiler
26
+ //~^ ERROR: requires the `avx` target feature, which is not enabled
31
27
todo ! ( )
32
28
}
33
29
@@ -56,25 +52,20 @@ unsafe fn test() {
56
52
unsafe fn in_closure ( ) -> impl FnOnce ( ) -> __m256 {
57
53
#[ inline( always) ] // this disables target-feature inheritance
58
54
|| g ( )
59
- //~^ WARNING requires the `avx` target feature, which is not enabled in the caller
60
- //~| WARNING this was previously accepted by the compiler
55
+ //~^ ERROR requires the `avx` target feature, which is not enabled in the caller
61
56
}
62
57
63
58
fn main ( ) {
64
59
unsafe {
65
60
f ( g ( ) ) ;
66
- //~^ WARNING requires the `avx` target feature, which is not enabled in the caller
67
- //~| WARNING requires the `avx` target feature, which is not enabled in the caller
68
- //~| WARNING this was previously accepted by the compiler
69
- //~| WARNING this was previously accepted by the compiler
61
+ //~^ ERROR requires the `avx` target feature, which is not enabled in the caller
62
+ //~| ERROR requires the `avx` target feature, which is not enabled in the caller
70
63
}
71
64
72
65
unsafe {
73
66
gavx ( favx ( ) ) ;
74
- //~^ WARNING requires the `avx` target feature, which is not enabled in the caller
75
- //~| WARNING requires the `avx` target feature, which is not enabled in the caller
76
- //~| WARNING this was previously accepted by the compiler
77
- //~| WARNING this was previously accepted by the compiler
67
+ //~^ ERROR requires the `avx` target feature, which is not enabled in the caller
68
+ //~| ERROR requires the `avx` target feature, which is not enabled in the caller
78
69
}
79
70
80
71
unsafe {
@@ -83,10 +74,8 @@ fn main() {
83
74
84
75
unsafe {
85
76
w ( Wrapper ( g ( ) ) ) ;
86
- //~^ WARNING requires the `avx` target feature, which is not enabled in the caller
87
- //~| WARNING requires the `avx` target feature, which is not enabled in the caller
88
- //~| WARNING this was previously accepted by the compiler
89
- //~| WARNING this was previously accepted by the compiler
77
+ //~^ ERROR requires the `avx` target feature, which is not enabled in the caller
78
+ //~| ERROR requires the `avx` target feature, which is not enabled in the caller
90
79
}
91
80
92
81
unsafe {
@@ -99,8 +88,7 @@ fn main() {
99
88
fn some_extern ( ) -> __m256 ;
100
89
}
101
90
some_extern ( ) ;
102
- //~^ WARNING requires the `avx` target feature, which is not enabled in the caller
103
- //~| WARNING this was previously accepted by the compiler
91
+ //~^ ERROR requires the `avx` target feature, which is not enabled in the caller
104
92
}
105
93
}
106
94
0 commit comments