summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/x86/check_cc.sh
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-05-16 15:03:52 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-16 15:03:52 -0700
commitd70933beec8c2cf0d8d4c984f103de9c75d4665b (patch)
treec13d93a935b25aed444a04f66358147418055811 /tools/testing/selftests/x86/check_cc.sh
parent4b470f120817a16ea28da6141ea6e3a3040b297b (diff)
parente9886ace222eb48bb57bd541320056ca334bd3a0 (diff)
downloadblackbird-obmc-linux-d70933beec8c2cf0d8d4c984f103de9c75d4665b.tar.gz
blackbird-obmc-linux-d70933beec8c2cf0d8d4c984f103de9c75d4665b.zip
Merge tag 'linux-kselftest-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull kselftest fixes from Shuah Khan: "Urgent fix for Kselftest regression introduced in 4.1-rc1 by the new x86 test due to its hard dependency on 32-bit build environment. A set of 5 patches fix the make kselftest run and kselftest install" * tag 'linux-kselftest-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests, x86: Rework x86 target architecture detection selftests, x86: Remove useless run_tests rule selftests/x86: install tests selftest/x86: have no dependency on all when cross building selftest/x86: build both bitnesses
Diffstat (limited to 'tools/testing/selftests/x86/check_cc.sh')
-rwxr-xr-xtools/testing/selftests/x86/check_cc.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/selftests/x86/check_cc.sh b/tools/testing/selftests/x86/check_cc.sh
new file mode 100755
index 000000000000..172d3293fb7b
--- /dev/null
+++ b/tools/testing/selftests/x86/check_cc.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+# check_cc.sh - Helper to test userspace compilation support
+# Copyright (c) 2015 Andrew Lutomirski
+# GPL v2
+
+CC="$1"
+TESTPROG="$2"
+shift 2
+
+if "$CC" -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then
+ echo 1
+else
+ echo 0
+fi
+
+exit 0
OpenPOWER on IntegriCloud