[clang] eddc485 - [Driver][test] Add -no-canonical-prefixes after D154357

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 14:39:56 PDT 2023


Author: Fangrui Song
Date: 2023-07-19T14:39:52-07:00
New Revision: eddc4850d81f4c9f79d0b17869d67eac8ca88070

URL: https://github.com/llvm/llvm-project/commit/eddc4850d81f4c9f79d0b17869d67eac8ca88070
DIFF: https://github.com/llvm/llvm-project/commit/eddc4850d81f4c9f79d0b17869d67eac8ca88070.diff

LOG: [Driver][test] Add -no-canonical-prefixes after D154357

If the path components of %clang contain a symlink, e.g.

```
% cd /tmp; ln -s Rel xxx
% /tmp/xxx/bin/clang --target=powerpc-unknown-eabi -xc /dev/null '-###'
InstalledDir: /tmp/xxx/bin
...
"-internal-isystem" "/tmp/Rel/bin/../lib/clang-runtimes/powerpc-unknown-eabi/include"
```

the test will fail. Such commands should use -no-canonical-prefixes, or
derive the include and library paths from cc1 -isysroot using driver
--sysroot.

Added: 
    

Modified: 
    clang/test/Driver/baremetal.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/baremetal.cpp b/clang/test/Driver/baremetal.cpp
index 4e29be813d152f..c04f4506a0994d 100644
--- a/clang/test/Driver/baremetal.cpp
+++ b/clang/test/Driver/baremetal.cpp
@@ -385,7 +385,7 @@
 // CHECK-RV32IMAFC-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv32imafc{{[/\\]+}}ilp32f{{[/\\]+}}lib"
 // CHECK-RV32IMAFC-SAME: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}baremetal{{[/\\]+}}rv32imafc{{[/\\]+}}ilp32f"
 
-// RUN: %clang %s -### --target=powerpc-unknown-eabi 2>&1 \
+// RUN: %clang -no-canonical-prefixes %s -### --target=powerpc-unknown-eabi 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-PPCEABI %s
 // CHECK-PPCEABI: InstalledDir: [[INSTALLEDDIR:.+]]
 // CHECK-PPCEABI: "-nostdsysteminc"
@@ -398,7 +398,7 @@
 // CHECK-PPCEABI-SAME: "-L[[RESOURCE]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
 // CHECK-PPCEABI-SAME: "-lc" "-lm" "-lclang_rt.builtins-powerpc" "-o" "a.out"
 
-// RUN: %clang %s -### --target=powerpc64-unknown-eabi 2>&1 \
+// RUN: %clang -no-canonical-prefixes %s -### --target=powerpc64-unknown-eabi 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-PPC64EABI %s
 // CHECK-PPC64EABI: InstalledDir: [[INSTALLEDDIR:.+]]
 // CHECK-PPC64EABI: "-nostdsysteminc"
@@ -411,7 +411,7 @@
 // CHECK-PPC64EABI-SAME: "-L[[RESOURCE]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
 // CHECK-PPC64EABI-SAME: "-lc" "-lm" "-lclang_rt.builtins-powerpc64" "-o" "a.out"
 
-// RUN: %clang %s -### --target=powerpcle-unknown-eabi 2>&1 \
+// RUN: %clang -no-canonical-prefixes %s -### --target=powerpcle-unknown-eabi 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-PPCLEEABI %s
 // CHECK-PPCLEEABI: InstalledDir: [[INSTALLEDDIR:.+]]
 // CHECK-PPCLEEABI: "-nostdsysteminc"
@@ -424,7 +424,7 @@
 // CHECK-PPCLEEABI-SAME: "-L[[RESOURCE]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
 // CHECK-PPCLEEABI-SAME: "-lc" "-lm" "-lclang_rt.builtins-powerpcle" "-o" "a.out"
 
-// RUN: %clang %s -### --target=powerpc64le-unknown-eabi 2>&1 \
+// RUN: %clang -no-canonical-prefixes %s -### --target=powerpc64le-unknown-eabi 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-PPC64LEEABI %s
 // CHECK-PPC64LEEABI: InstalledDir: [[INSTALLEDDIR:.+]]
 // CHECK-PPC64LEEABI: "-nostdsysteminc"


        


More information about the cfe-commits mailing list