summary refs log tree commit diff
path: root/pkgs/test/cc-wrapper
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2017-11-30 13:10:41 -0600
committerWill Dietz <w@wdtz.org>2017-12-05 07:17:14 -0600
commit9d8f9b2e531bf95a700a949d879927fb6996ffc9 (patch)
tree2496062d7832f418d939b5d1ce151ae3dff0889c /pkgs/test/cc-wrapper
parent115bf9d2cfae7400f4d69dc7fa02216a2c09ca32 (diff)
downloadnixpkgs-9d8f9b2e531bf95a700a949d879927fb6996ffc9.tar
nixpkgs-9d8f9b2e531bf95a700a949d879927fb6996ffc9.tar.gz
nixpkgs-9d8f9b2e531bf95a700a949d879927fb6996ffc9.tar.bz2
nixpkgs-9d8f9b2e531bf95a700a949d879927fb6996ffc9.tar.lz
nixpkgs-9d8f9b2e531bf95a700a949d879927fb6996ffc9.tar.xz
nixpkgs-9d8f9b2e531bf95a700a949d879927fb6996ffc9.tar.zst
nixpkgs-9d8f9b2e531bf95a700a949d879927fb6996ffc9.zip
Add clang multilib variants (x64_64-only, 64/32bit), basic multilib tests
Diffstat (limited to 'pkgs/test/cc-wrapper')
-rw-r--r--pkgs/test/cc-wrapper/multilib.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/test/cc-wrapper/multilib.nix b/pkgs/test/cc-wrapper/multilib.nix
new file mode 100644
index 00000000000..5ea50b5eb26
--- /dev/null
+++ b/pkgs/test/cc-wrapper/multilib.nix
@@ -0,0 +1,37 @@
+{ stdenv }:
+
+stdenv.mkDerivation {
+  name = "cc-multilib-test";
+
+  # XXX: "depend" on cc-wrapper test?
+
+  # TODO: Have tests report pointer size or something; ensure they are what we asked for
+  buildCommand = ''
+    NIX_DEBUG=1 $CC -v
+    NIX_DEBUG=1 $CXX -v
+
+    printf "checking whether compiler builds valid C binaries... " >&2
+    $CC -o cc-check ${./cc-main.c}
+    ./cc-check
+
+    printf "checking whether compiler builds valid 32bit C binaries... " >&2
+    $CC -m32 -o c32-check ${./cc-main.c}
+    ./c32-check
+
+    printf "checking whether compiler builds valid 64bit C binaries... " >&2
+    $CC -m64 -o c64-check ${./cc-main.c}
+    ./c64-check
+
+    printf "checking whether compiler builds valid 32bit C++ binaries... " >&2
+    $CXX -m32 -o cxx32-check ${./cxx-main.cc}
+    ./cxx32-check
+
+    printf "checking whether compiler builds valid 64bit C++ binaries... " >&2
+    $CXX -m64 -o cxx64-check ${./cxx-main.cc}
+    ./cxx64-check
+
+    touch $out
+  '';
+
+  meta.platforms = stdenv.lib.platforms.x86_64;
+}