52 lines · cpp
1// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -disable-llvm-passes -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 -disable-llvm-passes -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 -disable-llvm-passes -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 -disable-llvm-passes -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 -disable-llvm-passes -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 -disable-llvm-passes -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 -disable-llvm-passes -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 cwg124 { // cwg124: 2.716 17extern void full_expr_fence() NOTHROW;18 19struct A {20 A() NOTHROW {}21 ~A() NOTHROW {}22};23 24struct B {25 B(A = A()) NOTHROW {}26 ~B() NOTHROW {}27};28 29void f() {30 full_expr_fence();31 B b[2];32 full_expr_fence();33}34 35// CHECK-LABEL: define {{.*}} void @cwg124::f()()36// CHECK: call void @cwg124::full_expr_fence()37// CHECK: br label %arrayctor.loop38// CHECK-LABEL: arrayctor.loop:39// CHECK: call void @cwg124::A::A()40// CHECK: call void @cwg124::B::B(cwg124::A)41// CHECK: call void @cwg124::A::~A()42// CHECK: br {{.*}}, label %arrayctor.cont, label %arrayctor.loop43// CHECK-LABEL: arrayctor.cont:44// CHECK: call void @cwg124::full_expr_fence()45// CHECK: br label %arraydestroy.body46// CHECK-LABEL: arraydestroy.body:47// CHECK: call void @cwg124::B::~B()48// CHECK-LABEL: }49 50 51} // namespace cwg12452