Skip to content

Instantly share code, notes, and snippets.

@Endilll
Created May 17, 2023 15:05
Show Gist options
  • Save Endilll/77b802d4fc093a19731c5583cb6136a2 to your computer and use it in GitHub Desktop.
Save Endilll/77b802d4fc093a19731c5583cb6136a2 to your computer and use it in GitHub Desktop.
DR test notation with split-file
// Status quo
// ==========
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
namespace dr102 { // dr102: yes
template<typename T> T f(T a, T b) { return a + b; } // expected-error
} // namespace dr102
// dr103: na
// dr104: na lib
// dr105: na
namespace dr164 { // dr164: yes
template <class T> int g(T t) { return f(t); }
} // namespace dr164
namespace { // dr171: yes
int dr171a;
}
int dr171b;
namespace dr171 {
extern "C" void dr171b();
} // namespace dr171;
// dr174: sup 1012
// Extended lit, minimal changes to incorporate split-file
// =======================================================
// RUN: rm -rf %t && mkdir %t
// RUN: split-file %s %t
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
//--- dr102.cpp
namespace dr102 { // dr102: yes
template<typename T> T f(T a, T b) { return a + b; } // expected-error
} // namespace dr102
// dr103: na
// dr104: na lib
// dr105: na
//--- dr164.cpp
namespace dr164 { // dr164: yes
template <class T> int g(T t) { return f(t); }
} // namespace dr164
namespace { // dr171: yes
int dr171a;
}
int dr171b;
namespace dr171 {
extern "C" void dr171b(); // ISSUE: this test is in dr164.cpp now, which could be confusing
} // namespace dr171;
// dr174: sup 1012
// Extended lit, make_cxx_dr_status and split-file to integrate split-file into existing notation
// ==============================================================================================
// RUN: rm -rf %t && mkdir %t
// RUN: split-file %s %t
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
//--- dr102.cpp: yes
namespace dr102 {
template<typename T> T f(T a, T b) { return a + b; } // expected-error
} // namespace dr102
// dr103: na
// dr104: na lib
// dr105: na
//--- dr164.cpp: yes
namespace dr164 {
template <class T> int g(T t) { return f(t); }
} // namespace dr164
namespace { // dr171: yes
int dr171a;
}
int dr171b;
namespace dr171 {
extern "C" void dr171b(); // ISSUE: this test is in dr164.cpp now, which could be confusing
} // namespace dr171;
// dr174: sup 1012
// Extended lit, make_cxx_dr_status and split-file, with every test in its own file
// ================================================================================
// RUN: rm -rf %t && mkdir %t
// RUN: split-file %s %t
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %for_every_file_in %t -verify -fexceptions -fcxx-exceptions -pedantic-errors
//--- dr102.cpp: yes
template<typename T> T f(T a, T b) { return a + b; } // expected-error
// dr103: na
// dr104: na lib
// dr105: na
//--- dr164.cpp: yes
template <class T> int g(T t) { return f(t); }
//--- dr171.cpp: yes
namespace {
int dr171a;
}
int dr171b;
namespace dr171 {
extern "C" void dr171b(); // this test is in dr171.cpp now, so no confusion
// dr174: sup 1012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment