39 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 9namespace cwg441 { // cwg441: 2.710 11struct A {12 A() {}13};14 15A dynamic_init;16int i;17int& ir = i;18int* ip = &i;19 20} // namespace cwg44121 22// CHECK-DAG: @cwg441::dynamic_init = global %"struct.cwg441::A" zeroinitializer23// CHECK-DAG: @cwg441::i = global i32 024// CHECK-DAG: @cwg441::ir = constant ptr @cwg441::i25// CHECK-DAG: @cwg441::ip = global ptr @cwg441::i26// CHECK-DAG: @llvm.global_ctors = appending global [{{.+}}] [{ {{.+}} } { {{.+}}, ptr @_GLOBAL__sub_I_cwg441.cpp, {{.+}} }]27 28// CHECK-LABEL: define {{.*}} void @__cxx_global_var_init()29// CHECK-NEXT: entry:30// CHECK-NEXT: call void @cwg441::A::A()({{.*}} @cwg441::dynamic_init)31// CHECK-NEXT: ret void32// CHECK-NEXT: }33 34// CHECK-LABEL: define {{.*}} void @_GLOBAL__sub_I_cwg441.cpp()35// CHECK-NEXT: entry:36// CHECK-NEXT: call void @__cxx_global_var_init()37// CHECK-NEXT: ret void38// CHECK-NEXT: }39