ChuanqiXu added inline comments.
================ Comment at: clang/test/CodeGenCXX/static-variable-in-module.cpp:2-8 +// RUN: mkdir %t +// RUN: echo "struct S { S(); };" >> %t/foo.h +// RUN: echo "static S s = S();" >> %t/foo.h +// RUN: %clang -std=c++20 -I%t %s -S -emit-llvm -o - | FileCheck %s +module; +#include "foo.h" +export module m; ---------------- ChuanqiXu wrote: > urnathan wrote: > > rather than generate a foo.h file, why not (ab)use the preprocessor with > > internal line directives? > > > > ``` > > module; > > # 3 __FILE__ 1 // use the next physical line number here (and below) > > struct S { S(); }; > > static S s = S(); > > # 6 "" 2 > > export module m; > > ... > > ``` > Yeah, the form is useful when we need to add expected-* diagnostic message to > GMF. But I feel it is a little bit hacker. I guess the form mimics looks like > user more wouldn't be worse personally. Ok, I admit this is really helpful and time saving : ) (Now all my new test cases would be wrote in this form) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119409/new/ https://reviews.llvm.org/D119409 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits