Files
TheRock/compiler/amd-llvm/clang/test/CXX/drs/cwg2947.cpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

84 lines
4.1 KiB
C++

// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: split-file %s %t
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/cwg2947_example1.cpp -D'DOT_BAR=.bar'
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/cwg2947_example2.cpp -D'MOD_ATTR=[[vendor::shiny_module]]'
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/cwg2947_example3.cpp
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/cwg2947_example4.cpp
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/cwg2947_example5.cpp
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/cwg2947_example6.cpp
// RUN: %clang_cc1 -std=c++20 -E -verify %t/cwg2947_ext1.cpp | FileCheck %t/cwg2947_ext1.cpp
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/cwg2947_ext2.cpp
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/cwg2947_ext3.cpp
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %t/cwg2947_example1.cpp -D'DOT_BAR=.bar'
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %t/cwg2947_example2.cpp -D'MOD_ATTR=[[vendor::shiny_module]]'
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %t/cwg2947_example3.cpp
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %t/cwg2947_example4.cpp
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %t/cwg2947_example5.cpp
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %t/cwg2947_example6.cpp
// RUN: %clang_cc1 -std=c++23 -E -verify %t/cwg2947_ext1.cpp | FileCheck %t/cwg2947_ext1.cpp
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %t/cwg2947_ext2.cpp
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %t/cwg2947_ext3.cpp
// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify %t/cwg2947_example1.cpp -D'DOT_BAR=.bar'
// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify %t/cwg2947_example2.cpp -D'MOD_ATTR=[[vendor::shiny_module]]'
// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify %t/cwg2947_example3.cpp
// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify %t/cwg2947_example4.cpp
// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify %t/cwg2947_example5.cpp
// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify %t/cwg2947_example6.cpp
// RUN: %clang_cc1 -std=c++26 -E -verify %t/cwg2947_ext1.cpp | FileCheck %t/cwg2947_ext1.cpp
// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify %t/cwg2947_ext2.cpp
// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify %t/cwg2947_ext3.cpp
// cwg2947: 23
//--- cwg2947_example1.cpp
// #define DOT_BAR .bar
export module foo DOT_BAR; // error: expansion of DOT_BAR; does not begin with ; or [
// expected-error@-1 {{unexpected preprocessing token '.' after module name, only ';' and '[' (start of attribute specifier sequence) are allowed}}
//--- cwg2947_example2.cpp
export module M MOD_ATTR; // OK
// expected-warning@-1 {{unknown attribute 'vendor::shiny_module' ignored}}
//--- cwg2947_example3.cpp
export module a
.b; // error: preprocessing token after pp-module-name is not ; or [
// expected-error@-1 {{unexpected preprocessing token '.' after module name, only ';' and '[' (start of attribute specifier sequence) are allowed}}
//--- cwg2947_example4.cpp
export module M [[
attr1,
// expected-warning@-1 {{unknown attribute 'attr1' ignored}}
attr2 ]] ; // OK
// expected-warning@-1 {{unknown attribute 'attr2' ignored}}
//--- cwg2947_example5.cpp
export module M
[[ attr1,
// expected-warning@-1 {{unknown attribute 'attr1' ignored}}
attr2 ]] ; // OK
// expected-warning@-1 {{unknown attribute 'attr2' ignored}}
//--- cwg2947_example6.cpp
export module M; int
// expected-warning@-1 {{extra tokens after semicolon in 'module' directive}}
n; // OK
//--- cwg2947_ext1.cpp
// CHECK: export __preprocessed_module m; int x;
// CHECK: extern "C++" int *y = &x;
export module m; int x;
// expected-warning@-1 {{extra tokens after semicolon in 'module' directive}}
extern "C++" int *y = &x;
//--- cwg2947_ext2.cpp
export module x _Pragma("GCC warning \"Hi\"");
// expected-warning@-1 {{Hi}}
//--- cwg2947_ext3.cpp
export module x; _Pragma("GCC warning \"hi\""); // expected-warning {{hi}}
// expected-warning@-1 {{extra tokens after semicolon in 'module' directive}}