Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/cc add very simple test that you can link -fop...



details:   https://anonhg.NetBSD.org/src/rev/d1befef2428c
branches:  trunk
changeset: 448768:d1befef2428c
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Feb 09 00:12:14 2019 +0000

description:
add very simple test that you can link -fopenmp.

currently fails, but should work soon...

diffstat:

 tests/usr.bin/cc/Makefile     |   3 +-
 tests/usr.bin/cc/t_libgomp.sh |  50 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletions(-)

diffs (71 lines):

diff -r 3dcd9b171fae -r d1befef2428c tests/usr.bin/cc/Makefile
--- a/tests/usr.bin/cc/Makefile Fri Feb 08 23:27:14 2019 +0000
+++ b/tests/usr.bin/cc/Makefile Sat Feb 09 00:12:14 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2019/01/29 19:59:10 mgorny Exp $
+# $NetBSD: Makefile,v 1.7 2019/02/09 00:12:14 mrg Exp $
 
 .include <bsd.own.mk>
 
@@ -23,6 +23,7 @@
 TESTS_SH+=     $(ASAN_TESTS)
 TESTS_SH+=     $(UBSAN_TESTS)
 TESTS_SH+=     t_hello
+TESTS_SH+=     t_libgomp
 
 .for test in ${ASAN_TESTS}
 TESTS_SH_SRC_${test}=  asan_common.subr ${test}.sh
diff -r 3dcd9b171fae -r d1befef2428c tests/usr.bin/cc/t_libgomp.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/cc/t_libgomp.sh     Sat Feb 09 00:12:14 2019 +0000
@@ -0,0 +1,50 @@
+#      $NetBSD: t_libgomp.sh,v 1.1 2019/02/09 00:12:14 mrg Exp $
+#
+# Copyright (c) 2019 Matthew R. Green
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+#    derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+
+atf_test_case libgomp
+libgomp_head() {
+       atf_set "descr" "compile and hello world with -fopenmp"
+       atf_set "require.progs" "cc"
+}
+
+libgomp_body() {
+       cat > hello.c << EOF
+#include <stdio.h>
+#include <stdlib.h>
+int main(void) {printf("hello world\n");exit(0);}
+EOF
+       atf_check -s exit:0 -o ignore -e ignore cc -fopenmp -o hellogomp hello.c
+       atf_check -s exit:0 -o inline:"hello world\n" ./hellogomp
+}
+
+atf_init_test_cases()
+{
+
+       atf_add_test_case libgomp
+}



Home | Main Index | Thread Index | Old Index