[all-commits] [llvm/llvm-project] 83ea47: [test] Make tests pass regardless of gnu++14/gnu++...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Sep 3 22:29:49 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 83ea47acd7116bf50274534ba9b3bd3035c01da6
      https://github.com/llvm/llvm-project/commit/83ea47acd7116bf50274534ba9b3bd3035c01da6
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-09-04 (Sun, 04 Sep 2022)

  Changed paths:
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp
    M clang/test/AST/ast-dump-undeduced-expr.cpp
    M clang/test/AST/sourceranges.cpp
    M clang/test/Analysis/blocks.m
    M clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp
    M clang/test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp
    M clang/test/CXX/class.access/class.friend/p1.cpp
    M clang/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p2.cpp
    M clang/test/CXX/except/except.spec/p2-dynamic-types.cpp
    M clang/test/CXX/except/except.spec/p9-dynamic.cpp
    M clang/test/CXX/stmt.stmt/stmt.select/p3.cpp
    M clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
    M clang/test/CXX/temp/temp.res/temp.local/p3.cpp
    M clang/test/CodeGen/typedef_alignment_mismatch_warning.cpp
    M clang/test/CodeGenCXX/align-avx-complete-objects.cpp
    M clang/test/CodeGenCXX/copy-constructor-elim-2.cpp
    M clang/test/CodeGenCXX/debug-info-template-parameter.cpp
    M clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp
    M clang/test/CodeGenCXX/exception-spec-decay.cpp
    M clang/test/CodeGenCXX/exceptions-cxx-ehsc.cpp
    M clang/test/CodeGenCXX/exceptions-no-rtti.cpp
    M clang/test/CodeGenCXX/global-init.cpp
    M clang/test/CodeGenCXX/no-exceptions.cpp
    M clang/test/CodeGenCXX/override-bit-field-layout.cpp
    M clang/test/CodeGenCXX/override-layout.cpp
    M clang/test/CodeGenCXX/reference-temporary-ms.cpp
    M clang/test/CodeGenCXX/rtti-linkage.cpp
    M clang/test/Layout/ms-x86-vtordisp.cpp
    M clang/test/Modules/update-exception-spec.cpp
    M clang/test/OpenMP/declare_mapper_messages.cpp
    M clang/test/PCH/cxx-functions.cpp
    M clang/test/Parser/cxx-casting.cpp
    M clang/test/Parser/cxx-class.cpp
    M clang/test/Parser/cxx-template-argument.cpp
    M clang/test/Parser/cxx-template-decl.cpp
    M clang/test/Parser/cxx1z-nested-namespace-definition.cpp
    M clang/test/Sema/ms_class_layout.cpp
    M clang/test/SemaCXX/MicrosoftExtensions.cpp
    M clang/test/SemaCXX/PR12778.cpp
    M clang/test/SemaCXX/altivec.cpp
    M clang/test/SemaCXX/bool.cpp
    M clang/test/SemaCXX/default2.cpp
    M clang/test/SemaCXX/exception-spec-no-exceptions.cpp
    M clang/test/SemaCXX/exceptions.cpp
    M clang/test/SemaCXX/expressions.cpp
    M clang/test/SemaCXX/inline.cpp
    M clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
    M clang/test/SemaCXX/linkage2.cpp
    M clang/test/SemaCXX/member-pointer.cpp
    M clang/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
    M clang/test/SemaCXX/new-delete.cpp
    M clang/test/SemaCXX/static-data-member.cpp
    M clang/test/SemaCXX/type-definition-in-specifier.cpp
    M clang/test/SemaCXX/user-defined-conversions.cpp
    M clang/test/SemaCXX/warn-new-overaligned-3.cpp
    M clang/test/SemaCXX/warn-new-overaligned.cpp
    M clang/test/SemaCXX/writable-strings-deprecated.cpp
    M clang/test/SemaSYCL/zero-length-arrays.cpp
    M clang/test/SemaTemplate/class-template-id.cpp
    M clang/test/SemaTemplate/constructor-template.cpp
    M clang/test/SemaTemplate/explicit-instantiation.cpp
    M clang/test/SemaTemplate/instantiate-exception-spec.cpp
    M clang/test/SemaTemplate/instantiate-non-dependent-types.cpp
    M clang/test/SemaTemplate/instantiation-default-2.cpp
    M clang/test/SemaTemplate/temp_arg.cpp
    M clang/test/SemaTemplate/temp_arg_template.cpp
    M clang/test/SemaTemplate/typename-specifier-3.cpp
    M clang/unittests/AST/ASTTraverserTest.cpp
    M llvm/utils/lit/lit/llvm/config.py

  Log Message:
  -----------
  [test] Make tests pass regardless of gnu++14/gnu++17 default

GCC from 11 onwards defaults to -std=gnu++17 for C++ source files. We want to do the same
(https://discourse.llvm.org/t/c-objc-switch-to-gnu-17-as-the-default-dialect/64360).
Split RUN lines, adjust `-verify`, or add `__cplusplus < 201703L` or `-Wno-dynamic-exception-spec`,
so that tests will pass regardless of gnu++14/gnu++17 default.

We have a desire to mark a test compatible with multiple language standards.
There are ongoing discussions how to add markers in the long term:

* https://discourse.llvm.org/t/iterating-lit-run-lines/62596
* https://discourse.llvm.org/t/lit-run-a-run-line-multiple-times-with-different-replacements/64932

As a workaround in the short term, add lit substitutions `%std_cxx98-`,
`%std_cxx11-14`, etc. They can be used for tests which work across multiple
language standards. If a range has `n` standards, run lit multiple times, with
`LIT_CLANG_STD_GROUP=0`, `LIT_CLANG_STD_GROUP=1`, etc to cover all `n` standards.

Reviewed By: #clang-language-wg, aaron.ballman

Differential Revision: https://reviews.llvm.org/D131464




More information about the All-commits mailing list