[clang] [Clang][Driver][LTO] Fix empty stats filename when in LTO mode (PR #71197)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 4 16:17:40 PDT 2023


================
@@ -20,6 +20,8 @@
 // CHECK-INVALID: invalid value 'bla' in '-save-stats=bla'
 
 // RUN: %clang -target x86_64-linux-unknown -save-stats -flto -o obj/dir/save-stats.exe %s -### 2>&1 | FileCheck %s -check-prefix=CHECK-LTO
+// Previously `-plugin-opt=stats-file` would use empty filename if a linker flag (i.e. -Wl) is presented before any input filename.
+// RUN: %clang -target x86_64-linux-unknown -save-stats -flto -o obj/dir/save-stats.exe -Wl,-plugin-opt=-dummy %s -### 2>&1 | FileCheck %s -check-prefix=CHECK-LTO
----------------
MaskRay wrote:

Use `--target=` for new tests. `-target ` has been deprecated since Clang 3.4.

https://github.com/llvm/llvm-project/pull/71197


More information about the cfe-commits mailing list