jansvoboda11 added a comment.

Thanks for adding the tests. They are failing in CI though, and I don't think 
they're entirely correct.

My understanding is that the goal is to make sure Clang doesn't drop the `-cc1` 
flag when embedding command-lines into object files.

During normal compilation, the arguments given by the driver to 
`CompilerInvocation::CreateFromArgs()` already begin with `-cc1`, so I suggest 
setting up the tests to do so as well. We could use `{"-cc1", 
"-round-trip-args"}` in the first test case and `{"-cc1", 
"-no-round-trip-args"}` in the second.

We probably want to verify that the `CompilerInvocation` member used to store 
the command-line looks correctly. My guess is that the bitcode is using 
`CodeGenOptions::CommandLineArgs`, so I suggest checking that instead of 
`GeneratedArgs` in the final assertion.

(I feel like `GeneratedArgs` are an implementation detail in this particular 
test case. Moreover, the vector will be empty in the current revision, since 
you don't call `Invocation.generateCC1CommandLine(GeneratedArgs, *this)` like 
the surrounding test cases do.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130620/new/

https://reviews.llvm.org/D130620

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to