Home | History | Annotate | Download | only in Driver
      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 // 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 //
     47 // 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
     52 // CHECK-DEBIAN-X86: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
     53 // 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
     66 // CHECK-DEBIAN-X86-64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
     67 // 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"
     76 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
     77 // RUN:     -target powerpc-linux-gnu \
     78 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
     79 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s
     80 // CHECK-DEBIAN-PPC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
     81 // 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"
     90 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
     91 // RUN:     -target powerpc64-linux-gnu \
     92 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
     93 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s
     94 // CHECK-DEBIAN-PPC64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
     95 // 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"
    104