]> git.lizzy.rs Git - rust.git/commitdiff
test: Fix some tests to run with musl
authorAlex Crichton <alex@alexcrichton.com>
Fri, 24 Apr 2015 01:41:37 +0000 (18:41 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 28 Apr 2015 16:35:22 +0000 (09:35 -0700)
There were a few test cases to fix:

* Dynamic libraries are not supported with MUSL right now, so all of those
  related test which force or require dylibs are ignored.
* Looks like the default stack for MUSL is smaller than glibc, so a few stack
  allocations in benchmarks were boxed up (shouldn't have a perf impact).
* Some small linkage tweaks here and there
* Out-of-stack detection does not currently work with MUSL

mk/rt.mk
src/test/bench/noise.rs
src/test/bench/shootout-reverse-complement.rs
src/test/run-pass-fulldeps/issue-13560.rs
src/test/run-pass/issue-12133-3.rs
src/test/run-pass/linkage-visibility.rs
src/test/run-pass/out-of-stack-new-thread-no-split.rs
src/test/run-pass/sepcomp-extern.rs

index 6ca1445644122b50878481c90e684fd7da21560d..bd6578d3b724b9baeffaab93ac7d40fa81215747 100644 (file)
--- a/mk/rt.mk
+++ b/mk/rt.mk
@@ -113,7 +113,7 @@ $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)): $$(OBJS_$(2)_$(1))
 
 ifeq ($$(findstring windows,$(1)),windows)
 $$(RT_OUTPUT_DIR_$(1))/lib$(2).a: $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1))
-       $$(Q)cp $$< $$^
+       $$(Q)cp $$^ $$@
 endif
 
 endef
@@ -227,7 +227,7 @@ COMPRT_DEPS := $(wildcard \
               $(S)src/compiler-rt/*/*/*/*)
 endif
 
-COMPRT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
+COMPRT_NAME_$(1) := libcompiler-rt.a
 COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1))
 COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
 
index efbb5dfb5491ebe855be1249909590a2031c055a..81a6fb8ff6debbe064207a60c21b646d9973d258 100644 (file)
@@ -101,8 +101,8 @@ fn get(&self, x: f32, y: f32) -> f32 {
 
 fn main() {
     let symbols = [' ', '░', '▒', '▓', '█', '█'];
-    let mut pixels = [0f32; 256*256];
-    let n2d = Noise2DContext::new();
+    let mut pixels = Box::new([0f32; 256*256]);
+    let n2d = Box::new(Noise2DContext::new());
 
     for _ in 0..100 {
         for y in 0..256 {
index 7c9f33678a39c924fdabdd7849fe75a1bf865f49..55b2b1e2e324f600aa671bd9a98771b188ccefc4 100644 (file)
 use std::thread;
 
 struct Tables {
-    table8: [u8; 1 << 8],
-    table16: [u16; 1 << 16]
+    table8: Box<[u8; 1 << 8]>,
+    table16: Box<[u16; 1 << 16]>,
 }
 
 impl Tables {
     fn new() -> Tables {
-        let mut table8 = [0;1 << 8];
+        let mut table8 = Box::new([0;1 << 8]);
         for (i, v) in table8.iter_mut().enumerate() {
             *v = Tables::computed_cpl8(i as u8);
         }
-        let mut table16 = [0;1 << 16];
+        let mut table16 = Box::new([0;1 << 16]);
         for (i, v) in table16.iter_mut().enumerate() {
             *v = (table8[i & 255] as u16) << 8 |
                  table8[i >> 8]  as u16;
index 1541e809b6178d24a77c953d764e784c1dfcf023..fc9f241af7f10279671b309896ba0b64bd0ce085 100644 (file)
@@ -12,6 +12,7 @@
 // aux-build:issue-13560-2.rs
 // aux-build:issue-13560-3.rs
 // ignore-stage1
+// ignore-musl
 
 // Regression test for issue #13560, the test itself is all in the dependent
 // libraries. The fail which previously failed to compile is the one numbered 3.
index 79a530785452ac58c1bfa1d0f8694a452aae9594..66201ff901f309ce702e706b0e312be280919d48 100644 (file)
@@ -11,6 +11,7 @@
 // aux-build:issue-12133-rlib.rs
 // aux-build:issue-12133-dylib.rs
 // aux-build:issue-12133-dylib2.rs
+// ignore-musl
 
 // pretty-expanded FIXME #23616
 
index 74da4273b6ab0fb9b773425793bed9e05ae5df70..98a7ce55540d163a46f53ec203cb1a31cef0ca40 100644 (file)
@@ -11,6 +11,7 @@
 // aux-build:linkage-visibility.rs
 // ignore-android: FIXME(#10379)
 // ignore-windows: std::dynamic_lib does not work on Windows well
+// ignore-musl
 
 #![feature(std_misc)]
 
index 0d0a5bee8a443f879ddc00df20d2bf80d1a153de..2c6e55b57b066a5be9c766243ec93ffff9d5b3a0 100644 (file)
@@ -8,11 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//ignore-android
-//ignore-freebsd
-//ignore-ios
-//ignore-dragonfly
-//ignore-bitrig
+// ignore-android
+// ignore-freebsd
+// ignore-ios
+// ignore-dragonfly
+// ignore-bitrig
+// ignore-musl
 
 #![feature(asm)]
 
index 973c61712c3ed719dc88f96aa79e218d84a3774f..f21b787dab72f052c2bee89a6d38d4fe10b7af41 100644 (file)
@@ -14,8 +14,8 @@
 
 // Test accessing external items from multiple compilation units.
 
+extern crate sepcomp_extern_lib;
 
-#[link(name = "sepcomp_extern_lib")]
 extern {
     #[allow(ctypes)]
     fn foo() -> usize;