2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-01-05 22:50:09 +03:00
|
|
|
extern "C" {
|
|
|
|
extern "C" void f(int);
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "C++" {
|
|
|
|
extern "C++" int& g(int);
|
|
|
|
float& g();
|
|
|
|
}
|
|
|
|
double& g(double);
|
|
|
|
|
|
|
|
void test(int x, double d) {
|
|
|
|
f(x);
|
|
|
|
float &f1 = g();
|
|
|
|
int& i1 = g(x);
|
|
|
|
double& d1 = g(d);
|
|
|
|
}
|
2009-01-07 05:48:43 +03:00
|
|
|
|
|
|
|
extern "C" int foo;
|
|
|
|
extern "C" int foo;
|
|
|
|
|
|
|
|
extern "C" const int bar;
|
|
|
|
extern "C" int const bar;
|
2009-05-17 02:05:23 +04:00
|
|
|
|
|
|
|
// <rdar://problem/6895431>
|
|
|
|
extern "C" struct bar d;
|
|
|
|
extern struct bar e;
|
2009-08-24 22:55:03 +04:00
|
|
|
|
|
|
|
extern "C++" {
|
|
|
|
namespace N0 {
|
|
|
|
struct X0 {
|
|
|
|
int foo(int x) { return x; }
|
|
|
|
};
|
|
|
|
}
|
2009-11-08 04:45:36 +03:00
|
|
|
}
|
2009-11-08 14:36:54 +03:00
|
|
|
|
|
|
|
// PR5430
|
|
|
|
namespace pr5430 {
|
|
|
|
extern "C" void func(void);
|
|
|
|
}
|
|
|
|
using namespace pr5430;
|
|
|
|
extern "C" void pr5430::func(void) { }
|
2009-12-08 18:38:36 +03:00
|
|
|
|
|
|
|
// PR5404
|
|
|
|
int f2(char *)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
int f2(int)
|
|
|
|
{
|
|
|
|
return f2((char *)0);
|
|
|
|
}
|
|
|
|
}
|