Module Name: src
Committed By: mrg
Date: Sat Feb 9 00:12:14 UTC 2019
Modified Files:
src/tests/usr.bin/cc: Makefile
Added Files:
src/tests/usr.bin/cc: t_libgomp.sh
Log Message:
add very simple test that you can link -fopenmp.
currently fails, but should work soon...
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/cc/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/cc/t_libgomp.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/cc/Makefile
diff -u src/tests/usr.bin/cc/Makefile:1.6 src/tests/usr.bin/cc/Makefile:1.7
--- src/tests/usr.bin/cc/Makefile:1.6 Tue Jan 29 19:59:10 2019
+++ src/tests/usr.bin/cc/Makefile Sat Feb 9 00:12:14 2019
@@ -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= #
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
Added files:
Index: src/tests/usr.bin/cc/t_libgomp.sh
diff -u /dev/null src/tests/usr.bin/cc/t_libgomp.sh:1.1
--- /dev/null Sat Feb 9 00:12:14 2019
+++ src/tests/usr.bin/cc/t_libgomp.sh Sat Feb 9 00:12:14 2019
@@ -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
+}