File tree 1 file changed +18
-2
lines changed 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -99,13 +99,29 @@ pub fn spin_loop() {
99
99
/// This function is a no-op, and does not even read from `dummy`.
100
100
#[ unstable( feature = "test" , issue = "27812" ) ]
101
101
pub fn black_box < T > ( dummy : T ) -> T {
102
- #[ cfg( not( target_arch = "asmjs" ) ) ] {
102
+ #[ cfg( not(
103
+ any(
104
+ target_arch = "asmjs" ,
105
+ all(
106
+ target_arch = "wasm32" ,
107
+ target_os = "emscripten"
108
+ )
109
+ )
110
+ ) ) ] {
103
111
// we need to "use" the argument in some way LLVM can't
104
112
// introspect.
105
113
unsafe { asm ! ( "" : : "r" ( & dummy) ) }
106
114
dummy
107
115
}
108
- #[ cfg( target_arch = "asmjs" ) ] {
116
+ #[ cfg(
117
+ any(
118
+ target_arch = "asmjs" ,
119
+ all(
120
+ target_arch = "wasm32" ,
121
+ target_os = "emscripten"
122
+ )
123
+ )
124
+ ) ] {
109
125
unsafe {
110
126
let ret = crate :: ptr:: read_volatile ( & dummy) ;
111
127
crate :: mem:: forget ( dummy) ;
You can’t perform that action at this time.
0 commit comments