+2006-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * 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.
+
2006-11-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* tests/link-order2.at: Simplify logic to be a bit more self
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
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
LDFLAGS="$LDFLAGS -no-undefined"
AT_DATA([main.c],
-[[extern int inflate ();
+[[extern
+#ifdef __cplusplus
+"C"
+#endif
+int inflate ();
int main()
{
return inflate ();
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;
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;