35 lines · cpp
1// RUN: %clang_cc1 -dwarf-version=5 -emit-llvm -triple %itanium_abi_triple %s -o - \2// RUN: -x c++ -std=c++14 -O0 -disable-llvm-passes -debug-info-kind=limited \3// RUN: | FileCheck --check-prefix=CHECK-CPP14 %s4// RUN: %clang_cc1 -dwarf-version=3 -emit-llvm -triple %itanium_abi_triple %s -o - \5// RUN: -x c++ -std=c++14 -O0 -disable-llvm-passes -debug-info-kind=limited \6// RUN: | FileCheck --check-prefix=CHECK-CPP14 %s7// RUN: %clang_cc1 -dwarf-version=3 -emit-llvm -triple %itanium_abi_triple %s -o - \8// RUN: -x c++ -std=c++17 -O0 -disable-llvm-passes -debug-info-kind=limited \9// RUN: | FileCheck --check-prefix=CHECK-CPP17 %s10// RUN: %clang_cc1 -dwarf-version=3 -emit-llvm -triple %itanium_abi_triple %s -o - \11// RUN: -x c++ -std=c++20 -O0 -disable-llvm-passes -debug-info-kind=limited \12// RUN: | FileCheck --check-prefix=CHECK-CPP20 %s13// RUN: %clang_cc1 -dwarf-version=3 -gstrict-dwarf -emit-llvm -triple %itanium_abi_triple %s -o - \14// RUN: -x c++ -std=c++14 -O0 -disable-llvm-passes -debug-info-kind=limited | FileCheck %s15// RUN: %clang_cc1 -dwarf-version=5 -gstrict-dwarf -emit-llvm -triple %itanium_abi_triple %s -o - \16// RUN: -x c++ -std=c++14 -O0 -disable-llvm-passes -debug-info-kind=limited \17// RUN: | FileCheck --check-prefix=CHECK-CPP14 %s18 19int main() {20 return 0;21}22 23// Update these tests once support for DW_LANG_C_plus_plus_17/20 is added - it's24// a complicated tradeoff. The language codes are already published/blessed by25// the DWARF committee, but haven't been released in a published standard yet,26// so consumers might not be ready for these codes & could regress functionality27// (because they wouldn't be able to identify that the language was C++). The28// DWARFv6 language encoding, separating language from language version, would29// remove this problem/not require new codes for new language versions and make30// it possible to identify the base language irrespective of the version.31// CHECK-CPP14: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14,32// CHECK-CPP17: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14,33// CHECK-CPP20: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14,34// CHECK: distinct !DICompileUnit(language: DW_LANG_C_plus_plus,35