brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 0a6ac38 Raw
47 lines · cpp
1// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK2// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK3// RUN: %clang_cc1 -std=c++14 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK4// RUN: %clang_cc1 -std=c++17 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK5// RUN: %clang_cc1 -std=c++20 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK6// RUN: %clang_cc1 -std=c++23 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK7// RUN: %clang_cc1 -std=c++2c %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK8 9#if __cplusplus == 199711L10#define NOTHROW throw()11#else12#define NOTHROW noexcept(true)13#endif14 15namespace cwg193 { // cwg193: 2.716struct A {17  ~A() NOTHROW {}18};19 20struct B {21  ~B() NOTHROW {}22};23 24struct C {25  ~C() NOTHROW {}26};27 28struct D : A {29  B b;30  ~D() NOTHROW { C c; }31};32 33void foo() {34  D d;35}36 37// skipping over D1 (complete object destructor)38// CHECK-LABEL: define {{.*}} void @cwg193::D::~D(){{.*}}39// CHECK-LABEL: define {{.*}} void @cwg193::D::~D(){{.*}}40// CHECK-NOT:     call void @cwg193::A::~A()41// CHECK-NOT:     call void @cwg193::B::~B()42// CHECK:         call void @cwg193::C::~C()43// CHECK:         call void @cwg193::B::~B()44// CHECK:         call void @cwg193::A::~A()45// CHECK-LABEL: }46} // namespace cwg19347