mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-18 00:56:06 +00:00

- This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
43 lines
589 B
C++
43 lines
589 B
C++
// RUN: %clang_cc1 -emit-llvm -o %t %s
|
|
// RUN: grep "_ZN1CC1ERK1C" %t | count 0
|
|
// RUN: grep "_ZN1SC1ERK1S" %t | count 0
|
|
|
|
extern "C" int printf(...);
|
|
|
|
|
|
struct C {
|
|
C() : iC(6) {printf("C()\n"); }
|
|
C(const C& c) { printf("C(const C& c)\n"); }
|
|
int iC;
|
|
};
|
|
|
|
C foo() {
|
|
return C();
|
|
};
|
|
|
|
class X { // ...
|
|
public:
|
|
X(int) {}
|
|
X(const X&, int i = 1, int j = 2, C c = foo()) {
|
|
printf("X(const X&, %d, %d, %d)\n", i, j, c.iC);
|
|
}
|
|
};
|
|
|
|
|
|
struct S {
|
|
S();
|
|
};
|
|
|
|
S::S() { printf("S()\n"); }
|
|
|
|
void Call(S) {};
|
|
|
|
int main() {
|
|
X a(1);
|
|
X b(a, 2);
|
|
X c = b;
|
|
X d(a, 5, 6);
|
|
S s;
|
|
Call(s);
|
|
}
|