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 Correct hellp_pic ATF test in usr.bin/cc



details:   https://anonhg.NetBSD.org/src/rev/740a502782e8
branches:  trunk
changeset: 353591:740a502782e8
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat May 13 23:51:39 2017 +0000

description:
Correct hellp_pic ATF test in usr.bin/cc

Drop "-dPIC", this is misspelled "-DPIC" option for libtool.
Enhance code example to be more pedantic.

diffstat:

 tests/usr.bin/cc/t_hello.sh |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 0b1dcd21389d -r 740a502782e8 tests/usr.bin/cc/t_hello.sh
--- a/tests/usr.bin/cc/t_hello.sh       Sat May 13 21:27:11 2017 +0000
+++ b/tests/usr.bin/cc/t_hello.sh       Sat May 13 23:51:39 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_hello.sh,v 1.3 2016/04/03 14:41:30 gson Exp $
+#      $NetBSD: t_hello.sh,v 1.4 2017/05/13 23:51:39 kamil Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -62,15 +62,16 @@
 hello_pic_body() {
        cat > test.c << EOF
 #include <stdlib.h>
+int callpic(void);
 int main(void) {callpic();exit(0);}
 EOF
        cat > pic.c << EOF
 #include <stdio.h>
-int callpic(void) {printf("hello world\n");}
+int callpic(void) {printf("hello world\n");return 0;}
 EOF
 
        atf_check -s exit:0 -o ignore -e ignore \
-           cc -fPIC -dPIC -shared -o libtest.so pic.c
+           cc -fPIC -shared -o libtest.so pic.c
        atf_check -s exit:0 -o ignore -e ignore \
            cc -o hello test.c -L. -ltest
 



Home | Main Index | Thread Index | Old Index