2009-04-30 06:18:40 +00:00
|
|
|
// RUN: clang-cc -emit-llvm %s -o %t -triple=x86_64-apple-darwin9 &&
|
2009-02-13 00:10:09 +00:00
|
|
|
|
|
|
|
// FIXME: This test is intentionally trivial, because we can't yet
|
|
|
|
// CodeGen anything real in C++.
|
|
|
|
struct X { };
|
|
|
|
struct Y { };
|
2009-03-07 23:57:03 +00:00
|
|
|
|
|
|
|
// RUN: grep _ZplRK1YRA100_P1X %t | count 1 &&
|
2009-02-13 00:10:09 +00:00
|
|
|
bool operator+(const Y&, X* (&xs)[100]) { return false; }
|
|
|
|
|
2009-03-07 23:57:03 +00:00
|
|
|
// RUN: grep _Z1f1s %t | count 1 &&
|
|
|
|
typedef struct { int a; } s;
|
|
|
|
void f(s) { }
|
|
|
|
|
|
|
|
// RUN: grep _Z1f1e %t| count 1 &&
|
|
|
|
typedef enum { foo } e;
|
|
|
|
void f(e) { }
|
|
|
|
|
2009-03-10 17:07:44 +00:00
|
|
|
// RUN: grep _Z1f1u %t | count 1 &&
|
2009-03-07 23:57:03 +00:00
|
|
|
typedef union { int a; } u;
|
|
|
|
void f(u) { }
|
2009-03-10 17:07:44 +00:00
|
|
|
|
2009-04-02 05:55:18 +00:00
|
|
|
// RUN: grep _Z1f1x %t | count 1 &&
|
2009-03-10 17:07:44 +00:00
|
|
|
typedef struct { int a; } x,y;
|
|
|
|
void f(y) { }
|
|
|
|
|
2009-04-02 05:55:18 +00:00
|
|
|
// RUN: grep _Z1fv %t | count 1 &&
|
2009-04-01 00:15:23 +00:00
|
|
|
void f() { }
|
2009-04-01 00:58:25 +00:00
|
|
|
|
2009-04-02 05:55:18 +00:00
|
|
|
// RUN: grep _ZN1N1fEv %t | count 1 &&
|
2009-04-01 00:58:25 +00:00
|
|
|
namespace N { void f() { } }
|
|
|
|
|
2009-04-02 05:55:18 +00:00
|
|
|
// RUN: grep _ZN1N1N1fEv %t | count 1 &&
|
2009-04-01 00:58:25 +00:00
|
|
|
namespace N { namespace N { void f() { } } }
|
2009-04-02 05:55:18 +00:00
|
|
|
|
|
|
|
// RUN: grep unmangled_function %t | count 1 &&
|
|
|
|
extern "C" { namespace N { void unmangled_function() { } } }
|
|
|
|
|
2009-04-02 16:05:20 +00:00
|
|
|
// RUN: grep unmangled_variable %t | count 1 &&
|
2009-04-02 05:55:18 +00:00
|
|
|
extern "C" { namespace N { int unmangled_variable; } }
|
|
|
|
|
2009-04-02 16:24:45 +00:00
|
|
|
// RUN: grep _ZN1N1iE %t | count 1 &&
|
2009-04-02 16:05:20 +00:00
|
|
|
namespace N { int i; }
|
2009-04-02 16:24:45 +00:00
|
|
|
|
2009-04-13 18:03:33 +00:00
|
|
|
// RUN: grep _ZZN1N1fEiiE1b %t | count 2 &&
|
2009-04-02 16:24:45 +00:00
|
|
|
namespace N { int f(int, int) { static int b; return b; } }
|
2009-04-13 18:03:33 +00:00
|
|
|
|
|
|
|
// RUN: grep "_ZZN1N1gEvE1a =" %t | count 1 &&
|
2009-04-30 02:43:43 +00:00
|
|
|
// RUN: grep "_ZGVZN1N1gEvE1a =" %t | count 1 &&
|
2009-04-13 18:03:33 +00:00
|
|
|
namespace N { int h(); void g() { static int a = h(); } }
|
2009-04-30 02:43:43 +00:00
|
|
|
|
|
|
|
// RUN: grep "_Z1fno" %t | count 1
|
|
|
|
void f(__int128_t, __uint128_t) { }
|