1 // 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 \ 6 // RUN: -target i386-unknown-linux \ 7 // 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" 15 // CHECK-UBUNTU-11-04: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include" 16 // CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/include" 17 // CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" 18 // 19 // 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 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 35 // RUN: -target arm-linux-gnueabihf \ 36 // RUN: --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \ 37 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-13-04-CROSS %s 38 // CHECK-UBUNTU-13-04-CROSS: "{{[^"]*}}clang{{[^"]*}}" "-cc1" 39 // CHECK-UBUNTU-13-04-CROSS: "-isysroot" "[[SYSROOT:[^"]+]]" 40 // CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/c++/4.7" 41 // CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/c++/4.7/backward" 42 // CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/arm-linux-gnueabihf/c++/4.7" 43 // CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/local/include" 44 // CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include" 45 // CHECK-UBUNTU-13-04-CROSS: "-internal-externc-isystem" "[[SYSROOT]]/include" 46 // CHECK-UBUNTU-13-04-CROSS: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" 47 // 48 // Test Ubuntu/Debian's new version of multiarch, with -m32. 49 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 50 // RUN: -target x86_64-unknown-linux-gnu -m32 \ 51 // RUN: --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \ 52 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-13-04-M32 %s 53 // CHECK-UBUNTU-13-04-M32: "{{[^"]*}}clang{{[^"]*}}" "-cc1" 54 // CHECK-UBUNTU-13-04-M32: "-triple" "i386-unknown-linux-gnu" 55 // CHECK-UBUNTU-13-04-M32: "-isysroot" "[[SYSROOT:[^"]+]]" 56 // CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7" 57 // 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" 58 // CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward" 59 // 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" 60 // 61 // Thoroughly exercise the Debian multiarch environment. 62 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 63 // RUN: -target i686-linux-gnu \ 64 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 65 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s 66 // CHECK-DEBIAN-X86: "{{[^"]*}}clang{{[^"]*}}" "-cc1" 67 // CHECK-DEBIAN-X86: "-isysroot" "[[SYSROOT:[^"]+]]" 68 // CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5" 69 // CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/i686-linux-gnu" 70 // CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/backward" 71 // CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/local/include" 72 // CHECK-DEBIAN-X86: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include" 73 // CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/i386-linux-gnu" 74 // CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/include" 75 // CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" 76 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 77 // RUN: -target x86_64-linux-gnu \ 78 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 79 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s 80 // CHECK-DEBIAN-X86-64: "{{[^"]*}}clang{{[^"]*}}" "-cc1" 81 // CHECK-DEBIAN-X86-64: "-isysroot" "[[SYSROOT:[^"]+]]" 82 // CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5" 83 // CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/x86_64-linux-gnu" 84 // CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/backward" 85 // CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/local/include" 86 // CHECK-DEBIAN-X86-64: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include" 87 // CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu" 88 // CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/include" 89 // CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" 90 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 91 // RUN: -target powerpc-linux-gnu \ 92 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 93 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s 94 // CHECK-DEBIAN-PPC: "{{[^"]*}}clang{{[^"]*}}" "-cc1" 95 // CHECK-DEBIAN-PPC: "-isysroot" "[[SYSROOT:[^"]+]]" 96 // CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5" 97 // CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/powerpc-linux-gnu" 98 // CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/backward" 99 // CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/local/include" 100 // CHECK-DEBIAN-PPC: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include" 101 // CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc-linux-gnu" 102 // CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/include" 103 // CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" 104 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 105 // RUN: -target powerpc64-linux-gnu \ 106 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 107 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s 108 // CHECK-DEBIAN-PPC64: "{{[^"]*}}clang{{[^"]*}}" "-cc1" 109 // CHECK-DEBIAN-PPC64: "-isysroot" "[[SYSROOT:[^"]+]]" 110 // CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5" 111 // CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/powerpc64-linux-gnu" 112 // CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/backward" 113 // CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/local/include" 114 // CHECK-DEBIAN-PPC64: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{(64|32)?}}{{/|\\\\}}clang{{/|\\\\}}{{[0-9]\.[0-9]}}{{/|\\\\}}include" 115 // CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc64-linux-gnu" 116 // CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/include" 117 // CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" 118