1 // Test that the driver adds an arch-specific subdirectory in
2 // {RESOURCE_DIR}/lib/linux to the search path.
4 // RUN: %clang %s -### 2>&1 -target i386-unknown-linux \
5 // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
6 // RUN: | FileCheck --check-prefixes=FILEPATH,ARCHDIR-i386 %s
8 // RUN: %clang %s -### 2>&1 -target i386-unknown-linux \
9 // RUN: -resource-dir=%S/Inputs/resource_dir \
10 // RUN: | FileCheck --check-prefixes=FILEPATH,NO-ARCHDIR %s
12 // RUN: %clang %s -### 2>&1 -target i686-unknown-linux \
13 // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
14 // RUN: | FileCheck --check-prefixes=FILEPATH,ARCHDIR-i386 %s
16 // RUN: %clang %s -### 2>&1 -target i686-unknown-linux \
17 // RUN: -resource-dir=%S/Inputs/resource_dir \
18 // RUN: | FileCheck --check-prefixes=FILEPATH,NO-ARCHDIR %s
20 // RUN: %clang %s -### 2>&1 -target x86_64-unknown-linux \
21 // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
22 // RUN: | FileCheck --check-prefixes=FILEPATH,ARCHDIR-x86_64 %s
24 // RUN: %clang %s -### 2>&1 -target x86_64-unknown-linux \
25 // RUN: -resource-dir=%S/Inputs/resource_dir \
26 // RUN: | FileCheck --check-prefixes=FILEPATH,NO-ARCHDIR %s
28 // RUN: %clang %s -### 2>&1 -target arm-unknown-linux \
29 // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
30 // RUN: | FileCheck --check-prefixes=FILEPATH,ARCHDIR-arm %s
32 // RUN: %clang %s -### 2>&1 -target arm-unknown-linux \
33 // RUN: -resource-dir=%S/Inputs/resource_dir \
34 // RUN: | FileCheck --check-prefixes=FILEPATH,NO-ARCHDIR %s
36 // RUN: %clang %s -### 2>&1 -target aarch64-unknown-linux \
37 // RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
38 // RUN: | FileCheck --check-prefixes=FILEPATH,ARCHDIR-aarch64 %s
40 // RUN: %clang %s -### 2>&1 -target aarch64-unknown-linux \
41 // RUN: -resource-dir=%S/Inputs/resource_dir \
42 // RUN: | FileCheck --check-prefixes=FILEPATH,NO-ARCHDIR %s
45 // FILEPATH: "-x" "c" "[[FILE_PATH:.*]]{{(/|\\\\).*}}.c"
46 // ARCHDIR-i386: -L[[FILE_PATH]]{{(/|\\\\)Inputs(/|\\\\)resource_dir_with_arch_subdir(/|\\\\)lib(/|\\\\)linux(/|\\\\)i386}}
47 // ARCHDIR-x86_64: -L[[FILE_PATH]]{{(/|\\\\)Inputs(/|\\\\)resource_dir_with_arch_subdir(/|\\\\)lib(/|\\\\)linux(/|\\\\)x86_64}}
48 // ARCHDIR-arm: -L[[FILE_PATH]]{{(/|\\\\)Inputs(/|\\\\)resource_dir_with_arch_subdir(/|\\\\)lib(/|\\\\)linux(/|\\\\)arm}}
49 // ARCHDIR-aarch64: -L[[FILE_PATH]]{{(/|\\\\)Inputs(/|\\\\)resource_dir_with_arch_subdir(/|\\\\)lib(/|\\\\)linux(/|\\\\)aarch64}}
51 // Have a stricter check for no-archdir - that the driver doesn't add any
52 // subdirectory from the provided resource directory.
53 // NO-ARCHDIR-NOT: -L[[FILE_PATH]]/Inputs/resource_dir