@@ -33,11 +33,13 @@
/* Simplified version of c2eabi1.cc - Do not include other system
headers here. Simply forward declare the library functions used
by this header. */
-extern void abort(void);
-extern int abs(int);
-extern void exit(int);
-extern double fabs(double);
-extern int printf(const char *, ...);
+extern "C" {
+ extern void abort(void);
+ extern int abs(int);
+ extern void exit(int);
+ extern double fabs(double);
+ extern int printf(const char *, ...);
+}
/* All these functions are defined to use the base ABI, so use the
attribute to ensure the tests use the base ABI to call them even
@@ -1,10 +1,17 @@
// { dg-do run }
+
#include "x1ten-hellos.h"
int main(void)
{
A a;
- for (int i = 0; i < 10; i++)
+ int i;
+
+ for (i = 0; i < 10; i++)
a.hello();
- return 0;
+
+ if (i != 10)
+ abort ();
+
+ exit (0);
}
@@ -1,6 +1,10 @@
#ifndef A_H_
#define A_H_
-#include <stdio.h>
+extern "C" {
+ int printf(const char*, ...);
+ void abort(void);
+ void exit(int);
+};
class A
{