| 1 |
// RUN: %clang_cc1 -std=c++11 -triple i686-pc-win32 %s -fms-extensions -fno-rtti -emit-llvm -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-CXX |
| 2 |
// RUN: %clang_cc1 -x c -Wno-strict-prototypes -triple i686-pc-win32 %s -fms-extensions -fno-rtti -emit-llvm -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-C |
| 3 |
|
| 4 |
// Similar to predefined-expr.cpp, but not as exhaustive, since it's basically |
| 5 |
// equivalent to __PRETTY_FUNCTION__. |
| 6 |
|
| 7 |
#ifdef __cplusplus |
| 8 |
extern "C" |
| 9 |
#endif |
| 10 |
int printf(const char *, ...); |
| 11 |
|
| 12 |
void funcNoProto() { |
| 13 |
printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); |
| 14 |
} |
| 15 |
// CHECK-C: @"??_C@_0BL@IHLLLCAO@void?5__cdecl?5funcNoProto?$CI?$CJ?$AA@" = linkonce_odr dso_local unnamed_addr constant [27 x i8] c"void __cdecl funcNoProto()\00" |
| 16 |
// CHECK-CXX: @"??_C@_0BP@PJOECCJN@void?5__cdecl?5funcNoProto?$CIvoid?$CJ?$AA@" = linkonce_odr dso_local unnamed_addr constant [31 x i8] c"void __cdecl funcNoProto(void)\00" |
| 17 |
|
| 18 |
void funcNoParams(void) { |
| 19 |
printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); |
| 20 |
} |
| 21 |
// CHECK: @"??_C@_0CA@GBIDFNBN@void?5__cdecl?5funcNoParams?$CIvoid?$CJ?$AA@" = linkonce_odr dso_local unnamed_addr constant [32 x i8] c"void __cdecl funcNoParams(void)\00" |
| 22 |
|
| 23 |
void freeFunc(int *p, char c) { |
| 24 |
printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); |
| 25 |
} |
| 26 |
// CHECK: @"??_C@_0CD@KLGMNNL@void?5__cdecl?5freeFunc?$CIint?5?$CK?0?5cha@" = linkonce_odr dso_local unnamed_addr constant [{{.*}} x i8] c"void __cdecl freeFunc(int *, char)\00" |
| 27 |
|
| 28 |
#ifdef __cplusplus |
| 29 |
void funcVarargs(...) { |
| 30 |
printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); |
| 31 |
} |
| 32 |
// CHECK-CXX: @"??_C@_0BO@BOBPLEKP@void?5__cdecl?5funcVarargs?$CI?4?4?4?$CJ?$AA@" = linkonce_odr dso_local unnamed_addr constant [30 x i8] c"void __cdecl funcVarargs(...)\00" |
| 33 |
|
| 34 |
struct TopLevelClass { |
| 35 |
void topLevelMethod(int *, char); |
| 36 |
}; |
| 37 |
void TopLevelClass::topLevelMethod(int *, char) { |
| 38 |
printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); |
| 39 |
} |
| 40 |
// CHECK-CXX: @"??_C@_0DL@OBHNMDP@void?5__thiscall?5TopLevelClass?3?3t@" = linkonce_odr dso_local unnamed_addr constant [{{.*}} x i8] c"void __thiscall TopLevelClass::topLevelMethod(int *, char)\00" |
| 41 |
|
| 42 |
namespace NS { |
| 43 |
struct NamespacedClass { |
| 44 |
void namespacedMethod(int *, char); |
| 45 |
}; |
| 46 |
void NamespacedClass::namespacedMethod(int *, char) { |
| 47 |
printf("__FUNCSIG__ %s\n\n", __FUNCSIG__); |
| 48 |
} |
| 49 |
// CHECK-CXX: @"??_C@_0ED@PFDKIEBA@void?5__thiscall?5NS?3?3NamespacedCl@" = linkonce_odr dso_local unnamed_addr constant [{{.*}} x i8] c"void __thiscall NS::NamespacedClass::namespacedMethod(int *, char)\00" |
| 50 |
} |
| 51 |
#endif |