1*ed128c7dSVlad Serebrennikov // 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 CHECK
2*ed128c7dSVlad Serebrennikov // 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 CHECK
3*ed128c7dSVlad Serebrennikov // 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 CHECK
4*ed128c7dSVlad Serebrennikov // 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 CHECK
5*ed128c7dSVlad Serebrennikov // 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 CHECK
6*ed128c7dSVlad Serebrennikov // 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 CHECK
7*ed128c7dSVlad Serebrennikov // 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 CHECK
8*ed128c7dSVlad Serebrennikov
9*ed128c7dSVlad Serebrennikov #if __cplusplus == 199711L
10*ed128c7dSVlad Serebrennikov #define NOTHROW throw()
11*ed128c7dSVlad Serebrennikov #else
12*ed128c7dSVlad Serebrennikov #define NOTHROW noexcept(true)
13*ed128c7dSVlad Serebrennikov #endif
14*ed128c7dSVlad Serebrennikov
15*ed128c7dSVlad Serebrennikov namespace cwg201 { // cwg201: 2.8
16*ed128c7dSVlad Serebrennikov
17*ed128c7dSVlad Serebrennikov extern void full_expr_fence() NOTHROW;
18*ed128c7dSVlad Serebrennikov
19*ed128c7dSVlad Serebrennikov struct A {
~Acwg201::A20*ed128c7dSVlad Serebrennikov ~A() NOTHROW {}
21*ed128c7dSVlad Serebrennikov };
22*ed128c7dSVlad Serebrennikov
23*ed128c7dSVlad Serebrennikov struct B {
Bcwg201::B24*ed128c7dSVlad Serebrennikov B(A) NOTHROW {}
~Bcwg201::B25*ed128c7dSVlad Serebrennikov ~B() NOTHROW {}
26*ed128c7dSVlad Serebrennikov };
27*ed128c7dSVlad Serebrennikov
foo()28*ed128c7dSVlad Serebrennikov void foo() {
29*ed128c7dSVlad Serebrennikov full_expr_fence();
30*ed128c7dSVlad Serebrennikov B b = A();
31*ed128c7dSVlad Serebrennikov full_expr_fence();
32*ed128c7dSVlad Serebrennikov }
33*ed128c7dSVlad Serebrennikov
34*ed128c7dSVlad Serebrennikov // CHECK-LABEL: define {{.*}} void @cwg201::foo()
35*ed128c7dSVlad Serebrennikov // CHECK: call void @cwg201::full_expr_fence()
36*ed128c7dSVlad Serebrennikov // CHECK: call void @cwg201::B::B(cwg201::A)
37*ed128c7dSVlad Serebrennikov // CHECK: call void @cwg201::A::~A()
38*ed128c7dSVlad Serebrennikov // CHECK: call void @cwg201::full_expr_fence()
39*ed128c7dSVlad Serebrennikov // CHECK: call void @cwg201::B::~B()
40*ed128c7dSVlad Serebrennikov // CHECK-LABEL: }
41*ed128c7dSVlad Serebrennikov
42*ed128c7dSVlad Serebrennikov } // namespace cwg201
43