brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 2f22ad2 Raw
77 lines · cpp
1// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -emit-llvm %s -o - | FileCheck %s2 3struct A {4  A(); A(const A&); A(A&&); A &operator=(const A&); A &operator=(A&&); ~A();5};6struct B {7  B(); B(const B&); B(B&&); B &operator=(const B&); B &operator=(B&&); ~B();8};9 10union U {11  U();12  U(const U &);13  U(U &&);14  U &operator=(const U&);15  U &operator=(U&&);16  ~U();17 18  A a;19  int n;20};21 22// CHECK-NOT: _ZN1A23U::U() {}24U::U(const U&) {}25U::U(U&&) {}26U &U::operator=(const U&) { return *this; }27U &U::operator=(U &&) { return *this; }28U::~U() {}29 30struct S {31  S();32  S(const S &);33  S(S &&);34  S &operator=(const S&);35  S &operator=(S&&);36  ~S();37 38  union {39    A a;40    int n;41  };42  B b;43  int m;44};45 46// CHECK: _ZN1SC2Ev47// CHECK-NOT: _ZN1A48// CHECK: _ZN1BC1Ev49S::S() {}50 51// CHECK-NOT: _ZN1A52 53// CHECK: _ZN1SC2ERKS_54// CHECK-NOT: _ZN1A55// CHECK: _ZN1BC1Ev56S::S(const S&) {}57 58// CHECK-NOT: _ZN1A59 60// CHECK: _ZN1SC2EOS_61// CHECK-NOT: _ZN1A62// CHECK: _ZN1BC1Ev63S::S(S&&) {}64 65// CHECK-NOT: _ZN1A66// CHECK-NOT: _ZN1B67S &S::operator=(const S&) { return *this; }68 69S &S::operator=(S &&) { return *this; }70 71// CHECK: _ZN1SD2Ev72// CHECK-NOT: _ZN1A73// CHECK: _ZN1BD1Ev74S::~S() {}75 76// CHECK-NOT: _ZN1A77