[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: clean testsuite for g++ and gcc -Wall
From: |
Ralf Wildenhues |
Subject: |
FYI: clean testsuite for g++ and gcc -Wall |
Date: |
Thu, 14 Dec 2006 21:59:29 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Applied to HEAD.
The failure of the link-order2 test with g++ shows how limited this
usage case is. :-/
Cheers,
Ralf
2006-12-14 Ralf Wildenhues <address@hidden>
* tests/link-order2.at: Define our override `sin' function with
C binding even if $CC is a C++ compiler. Skip the test with g++
as its command line driver reorders `-lm'.
* tests/search-path.at: Declare `inflate' with C binding.
* tests/stresstest.at: Avoid unused variable warnings.
Index: tests/link-order2.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/link-order2.at,v
retrieving revision 1.3
diff -u -r1.3 link-order2.at
--- tests/link-order2.at 7 Nov 2006 17:53:22 -0000 1.3
+++ tests/link-order2.at 14 Dec 2006 20:58:54 -0000
@@ -24,6 +24,16 @@
AT_SETUP([Link order of deplibs.])
AT_KEYWORDS([libtool])
+
+# g++ reorders `-lm' on the command line. :-(
+AT_DATA([t.c], [[
+#if defined(__cplusplus) && defined(__GNUC__)
+choke me
+#endif
+int t = 42;
+]])
+AT_CHECK([$CC $CPPFLAGS $CFLAGS -c t.c || exit 77], [], [ignore], [ignore])
+
LDFLAGS="$LDFLAGS -no-undefined"
libdir=`pwd`/inst/lib
bindir=`pwd`/inst/bin
@@ -31,11 +41,17 @@
cat >a.c <<\EOF
/* pretend we have a better sine function */
+#ifdef __cplusplus
+extern "C"
+#endif
double sin (double x) { return 0.0; }
EOF
cat >b.c <<\EOF
-extern double sin (double);
+#ifdef __cplusplus
+extern "C"
+#endif
+double sin (double);
double b (double x) { return sin (x); }
EOF
Index: tests/search-path.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/search-path.at,v
retrieving revision 1.1
diff -u -r1.1 search-path.at
--- tests/search-path.at 24 Oct 2006 20:17:38 -0000 1.1
+++ tests/search-path.at 14 Dec 2006 20:58:54 -0000
@@ -21,7 +21,11 @@
LDFLAGS="$LDFLAGS -no-undefined"
AT_DATA([main.c],
-[[extern int inflate ();
+[[extern
+#ifdef __cplusplus
+"C"
+#endif
+int inflate ();
int main()
{
return inflate ();
Index: tests/stresstest.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/stresstest.at,v
retrieving revision 1.10
diff -u -r1.10 stresstest.at
--- tests/stresstest.at 4 Sep 2006 17:27:26 -0000 1.10
+++ tests/stresstest.at 14 Dec 2006 20:58:55 -0000
@@ -45,7 +45,7 @@
const int v6 = 1;
const char* v7 = "\01foo";
const char v8[] = "\01bar";
-int v9(void) { return 1; }
+int v9(void) { return v2 + 1; }
int (*v10) (void);
int (*v11) (void) = v9;
int (*const v12) (void) = v9;
@@ -165,7 +165,7 @@
const int w6 = 1;
const char* w7 = "\01foo";
const char w8[] = "\01bar";
-int w9(void) { return 1; }
+int w9(void) { return w2 + 1; }
int (*w10) (void);
int (*w11) (void) = w9;
int (*const w12) (void) = w9;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: clean testsuite for g++ and gcc -Wall,
Ralf Wildenhues <=