xref: /llvm-project/clang/test/Headers/stdarg-cxx-modules.cpp (revision f3761a4bd320e4334315c87b55f882a4ba864caa)
1 // RUN: rm -fR %t
2 // RUN: split-file %s %t
3 // RUN: cd %t
4 // RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header h1.h
5 // RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header h2.h -fmodule-file=h1.pcm
6 // RUN: %clang_cc1 -std=c++20 -fsyntax-only main.cpp -fmodule-file=h1.pcm -fmodule-file=h2.pcm
7 
8 //--- h1.h
9 #include <stdarg.h>
10 // expected-no-diagnostics
11 
12 //--- h2.h
13 import "h1.h";
14 // expected-no-diagnostics
15 
16 //--- main.cpp
17 import "h1.h";
18 import "h2.h";
19 
20 void foo(int x, ...) {
21   va_list v;
22   va_start(v, x);
23   va_end(v);
24 }
25 // expected-no-diagnostics
26