[clang][Driver] Support simplified triple versions for config files (#111387)
[llvm-project.git] / clang / test / Modules / predefined.cpp
blob8f897f5ace938f33c0213eb7d9e665f44027fee6
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: cd %t
5 // RUN: %clang_cc1 -x c++ -std=c++20 -emit-module-interface a.h -o a.pcm -fms-extensions -verify
6 // RUN: %clang_cc1 -std=c++20 a.cpp -fmodule-file=A=a.pcm -fms-extensions -fsyntax-only -verify
8 // RUN: %clang_cc1 -x c++ -std=c++20 -emit-reduced-module-interface a.h -o a.pcm -fms-extensions -verify
9 // RUN: %clang_cc1 -std=c++20 a.cpp -fmodule-file=A=a.pcm -fms-extensions -fsyntax-only -verify
11 //--- a.h
13 // expected-no-diagnostics
15 export module A;
17 export template <typename T>
18 void f() {
19 char a[] = __func__;
22 //--- a.cpp
24 // expected-warning@a.h:8 {{initializing an array from a '__func__' predefined identifier is a Microsoft extension}}
26 import A;
28 void g() {
29 f<int>(); // expected-note {{in instantiation of function template specialization 'f<int>' requested here}}