[clang] [Clang][InstrProf] Allow mix-up of absolute path with relative path on command line when using -fprofile-list= (PR #67519)

Henrik G. Olsson via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 16 09:25:23 PST 2023


================
@@ -4,7 +4,8 @@
 // RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t-func.list -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC
 
 // RUN: echo "src:%s" | sed -e 's/\\/\\\\/g' > %t-file.list
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t-file.list -emit-llvm %s -o - | FileCheck %s --check-prefix=FILE
+// RUN: cd %S
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t-file.list -emit-llvm profile-filter.c -o - | FileCheck %s --check-prefix=FILE
----------------
hnrklssn wrote:

Is `%s` an absolute or relative path? Either way, this only tests one of the cases. We should test both. I.e. if `%s` is the absolute path, there should also be a test for `"src:profile-filter.c"`. However, it `%s` is the absolute path, wasn't this already working before this patch? 

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


More information about the cfe-commits mailing list