File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 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() {
9999/// This function is a no-op, and does not even read from `dummy`.
100100#[ unstable( feature = "test" , issue = "27812" ) ]
101101pub 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+ ) ) ] {
103111 // we need to "use" the argument in some way LLVM can't
104112 // introspect.
105113 unsafe { asm ! ( "" : : "r" ( & dummy) ) }
106114 dummy
107115 }
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+ ) ] {
109125 unsafe {
110126 let ret = crate :: ptr:: read_volatile ( & dummy) ;
111127 crate :: mem:: forget ( dummy) ;
You can’t perform that action at this time.
0 commit comments