blob: d09f5b27ae9da41a99f43357f3a2549a46a88462 [file] [log] [blame]
Chandler Carruthd936d9d2011-11-09 03:46:20 +00001// General tests that the header search paths detected by the driver and passed
2// to CC1 are sane.
3//
4// Test a very broken version of multiarch that shipped in Ubuntu 11.04.
5// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
Sebastian Pop9ec60df2012-01-20 22:01:23 +00006// RUN: -target i386-unknown-linux \
Chandler Carruthd936d9d2011-11-09 03:46:20 +00007// RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
8// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
9// CHECK-UBUNTU-11-04: "{{.*}}clang{{.*}}" "-cc1"
10// CHECK-UBUNTU-11-04: "-isysroot" "[[SYSROOT:[^"]+]]"
11// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5"
12// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/i686-linux-gnu"
13// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/backward"
14// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
Chandler Carrutha7202872011-11-09 08:26:57 +000015// CHECK-UBUNTU-11-04: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
Chandler Carruthd936d9d2011-11-09 03:46:20 +000016// CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/include"
17// CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
Chandler Carruth079d2bb2012-02-26 09:21:43 +000018//
Dmitri Gribenkof2e7c352013-03-06 17:14:05 +000019// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
20// RUN: -target x86_64-unknown-linux-gnu \
21// RUN: --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \
22// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-13-04 %s
23// CHECK-UBUNTU-13-04: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
24// CHECK-UBUNTU-13-04: "-isysroot" "[[SYSROOT:[^"]+]]"
25// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7"
26// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward"
27// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/c++/4.7"
28// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
29// CHECK-UBUNTU-13-04: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
30// CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu"
31// CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/include"
32// CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
33//
34// Test Ubuntu/Debian's new version of multiarch, with -m32.
35// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
36// RUN: -target x86_64-unknown-linux-gnu -m32 \
37// RUN: --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \
38// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-13-04-M32 %s
39// CHECK-UBUNTU-13-04-M32: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
40// CHECK-UBUNTU-13-04-M32: "-triple" "i386-unknown-linux-gnu"
41// CHECK-UBUNTU-13-04-M32: "-isysroot" "[[SYSROOT:[^"]+]]"
42// CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7"
43// CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/x86_64-linux-gnu/32"
44// CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward"
45// CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/c++/4.7/32"
46//
Chandler Carruth079d2bb2012-02-26 09:21:43 +000047// Thoroughly exercise the Debian multiarch environment.
48// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
49// RUN: -target i686-linux-gnu \
50// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
51// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s
Benjamin Kramerf58b3882012-02-26 14:50:31 +000052// CHECK-DEBIAN-X86: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
Chandler Carruth079d2bb2012-02-26 09:21:43 +000053// CHECK-DEBIAN-X86: "-isysroot" "[[SYSROOT:[^"]+]]"
54// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5"
55// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/i686-linux-gnu"
56// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/backward"
57// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
58// CHECK-DEBIAN-X86: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
59// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/i386-linux-gnu"
60// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/include"
61// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
62// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
63// RUN: -target x86_64-linux-gnu \
64// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
65// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s
Benjamin Kramer5ed7dd62012-02-26 14:55:10 +000066// CHECK-DEBIAN-X86-64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
Chandler Carruth079d2bb2012-02-26 09:21:43 +000067// CHECK-DEBIAN-X86-64: "-isysroot" "[[SYSROOT:[^"]+]]"
68// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5"
69// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/x86_64-linux-gnu"
70// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/backward"
71// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
72// CHECK-DEBIAN-X86-64: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
73// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu"
74// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/include"
75// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
Rafael Espindola238b6a92012-10-09 20:46:28 +000076// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
Chandler Carruth079d2bb2012-02-26 09:21:43 +000077// RUN: -target powerpc-linux-gnu \
78// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
79// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s
Benjamin Kramer5ed7dd62012-02-26 14:55:10 +000080// CHECK-DEBIAN-PPC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
Chandler Carruth079d2bb2012-02-26 09:21:43 +000081// CHECK-DEBIAN-PPC: "-isysroot" "[[SYSROOT:[^"]+]]"
82// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5"
83// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/powerpc-linux-gnu"
84// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/backward"
85// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
86// CHECK-DEBIAN-PPC: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
87// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc-linux-gnu"
88// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/include"
89// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
Rafael Espindola238b6a92012-10-09 20:46:28 +000090// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
Chandler Carruth079d2bb2012-02-26 09:21:43 +000091// RUN: -target powerpc64-linux-gnu \
92// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
93// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s
Benjamin Kramer5ed7dd62012-02-26 14:55:10 +000094// CHECK-DEBIAN-PPC64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
Chandler Carruth079d2bb2012-02-26 09:21:43 +000095// CHECK-DEBIAN-PPC64: "-isysroot" "[[SYSROOT:[^"]+]]"
96// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5"
97// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/powerpc64-linux-gnu"
98// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/backward"
99// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
100// CHECK-DEBIAN-PPC64: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
101// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc64-linux-gnu"
102// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/include"
103// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"