| 1 |
// RUN: %clang_cc1 -std=c++2b -emit-llvm -triple x86_64-linux -o - %s 2>/dev/null | FileCheck %s |
| 2 |
|
| 3 |
struct S { |
| 4 |
friend void test(); |
| 5 |
public: |
| 6 |
void a(this auto){} |
| 7 |
void b(this auto&){} |
| 8 |
void c(this S){} |
| 9 |
void c(this S, int){} |
| 10 |
private: |
| 11 |
void d(this auto){} |
| 12 |
void e(this auto&){} |
| 13 |
void f(this S){} |
| 14 |
void f(this S, int){} |
| 15 |
protected: |
| 16 |
void g(this auto){} |
| 17 |
void h(this auto&){} |
| 18 |
void i(this S){} |
| 19 |
void i(this S, int){} |
| 20 |
}; |
| 21 |
|
| 22 |
|
| 23 |
void test() { |
| 24 |
S s; |
| 25 |
s.a(); |
| 26 |
// CHECK: call void @_ZNH1S1aIS_EEvT_ |
| 27 |
s.b(); |
| 28 |
// CHECK: call void @_ZNH1S1bIS_EEvRT_ |
| 29 |
s.c(); |
| 30 |
// CHECK: call void @_ZNH1S1cES_ |
| 31 |
s.c(0); |
| 32 |
// CHECK: call void @_ZNH1S1cES_i |
| 33 |
s.d(); |
| 34 |
// CHECK: call void @_ZNH1S1dIS_EEvT_ |
| 35 |
s.e(); |
| 36 |
// CHECK: call void @_ZNH1S1eIS_EEvRT_ |
| 37 |
s.f(); |
| 38 |
// CHECK: call void @_ZNH1S1fES_ |
| 39 |
s.f(0); |
| 40 |
// CHECK: call void @_ZNH1S1fES_i |
| 41 |
s.g(); |
| 42 |
// CHECK: call void @_ZNH1S1gIS_EEvT_ |
| 43 |
s.h(); |
| 44 |
// CHECK: call void @_ZNH1S1hIS_EEvRT_ |
| 45 |
s.i(); |
| 46 |
// CHECK: call void @_ZNH1S1iES_ |
| 47 |
s.i(0); |
| 48 |
// CHECK: call void @_ZNH1S1iES_i |
| 49 |
} |
| 50 |
|
| 51 |
struct StaticAndExplicit { |
| 52 |
static void f(StaticAndExplicit); |
| 53 |
void f(this StaticAndExplicit); |
| 54 |
}; |
| 55 |
|
| 56 |
void test2() { |
| 57 |
StaticAndExplicit s; |
| 58 |
|
| 59 |
StaticAndExplicit::f(s); |
| 60 |
// CHECK: call void @_ZN17StaticAndExplicit1fES_ |
| 61 |
|
| 62 |
s.f(); |
| 63 |
// CHECK: call void @_ZNH17StaticAndExplicit1fES_ |
| 64 |
} |