diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
| commit | dbe13110f59f48b4dbb7552b3ac2935acdeece7f (patch) | |
| tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/Driver | |
| parent | 9da628931ebf2609493570f87824ca22402cc65f (diff) | |
Notes
Diffstat (limited to 'test/Driver')
143 files changed, 1168 insertions, 208 deletions
diff --git a/test/Driver/Inputs/basic_freebsd64_tree/lib/.keep b/test/Driver/Inputs/basic_freebsd64_tree/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/basic_freebsd64_tree/lib/.keep diff --git a/test/Driver/Inputs/basic_freebsd64_tree/usr/lib/.keep b/test/Driver/Inputs/basic_freebsd64_tree/usr/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/basic_freebsd64_tree/usr/lib/.keep diff --git a/test/Driver/Inputs/basic_freebsd64_tree/usr/lib/crt1.o b/test/Driver/Inputs/basic_freebsd64_tree/usr/lib/crt1.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/basic_freebsd64_tree/usr/lib/crt1.o diff --git a/test/Driver/Inputs/basic_freebsd64_tree/usr/lib32/.keep b/test/Driver/Inputs/basic_freebsd64_tree/usr/lib32/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/basic_freebsd64_tree/usr/lib32/.keep diff --git a/test/Driver/Inputs/basic_freebsd_tree/lib/.keep b/test/Driver/Inputs/basic_freebsd_tree/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/basic_freebsd_tree/lib/.keep diff --git a/test/Driver/Inputs/basic_freebsd_tree/usr/lib/.keep b/test/Driver/Inputs/basic_freebsd_tree/usr/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/basic_freebsd_tree/usr/lib/.keep diff --git a/test/Driver/Inputs/basic_freebsd_tree/usr/lib/crt1.o b/test/Driver/Inputs/basic_freebsd_tree/usr/lib/crt1.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/basic_freebsd_tree/usr/lib/crt1.o diff --git a/test/Driver/Inputs/basic_freebsd_tree/usr/lib32/.keep b/test/Driver/Inputs/basic_freebsd_tree/usr/lib32/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/basic_freebsd_tree/usr/lib32/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/lib/.keep b/test/Driver/Inputs/debian_multiarch_tree/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/lib/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/lib/i386-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc64-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc64-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/lib/powerpc64-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/lib/x86_64-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/lib/x86_64-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/lib/x86_64-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/backward/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/backward/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/backward/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/i686-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/i686-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/i686-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc64-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc64-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/powerpc64-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/x86_64-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/x86_64-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/c++/4.5/x86_64-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/i386-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/i386-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/i386-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc64-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc64-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/powerpc64-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/include/x86_64-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/include/x86_64-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/include/x86_64-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/lib/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/i686-linux-gnu/4.5/crtbegin.o b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/i686-linux-gnu/4.5/crtbegin.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/i686-linux-gnu/4.5/crtbegin.o diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/powerpc-linux-gnu/4.5/crtbegin.o b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/powerpc-linux-gnu/4.5/crtbegin.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/powerpc-linux-gnu/4.5/crtbegin.o diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/powerpc64-linux-gnu/4.5/crtbegin.o b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/powerpc64-linux-gnu/4.5/crtbegin.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/powerpc64-linux-gnu/4.5/crtbegin.o diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/x86_64-linux-gnu/4.5/crtbegin.o b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/x86_64-linux-gnu/4.5/crtbegin.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/gcc/x86_64-linux-gnu/4.5/crtbegin.o diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/lib/i386-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/i386-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/i386-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc64-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc64-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/powerpc64-linux-gnu/.keep diff --git a/test/Driver/Inputs/debian_multiarch_tree/usr/lib/x86_64-linux-gnu/.keep b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/x86_64-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/debian_multiarch_tree/usr/lib/x86_64-linux-gnu/.keep diff --git a/test/Driver/Inputs/multiarch_freebsd64_tree/lib/.keep b/test/Driver/Inputs/multiarch_freebsd64_tree/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/multiarch_freebsd64_tree/lib/.keep diff --git a/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib/.keep b/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib/.keep diff --git a/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib/crt1.o b/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib/crt1.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib/crt1.o diff --git a/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib32/.keep b/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib32/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib32/.keep diff --git a/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib32/crt1.o b/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib32/crt1.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/multiarch_freebsd64_tree/usr/lib32/crt1.o diff --git a/test/Driver/Inputs/prefixed_tools_tree/x86_64--linux-as b/test/Driver/Inputs/prefixed_tools_tree/x86_64--linux-as new file mode 100755 index 000000000000..d90113476e87 --- /dev/null +++ b/test/Driver/Inputs/prefixed_tools_tree/x86_64--linux-as @@ -0,0 +1,2 @@ +#!/bin/sh +# This file must be executable to be picked up by GetProgramPath diff --git a/test/Driver/Inputs/prefixed_tools_tree/x86_64--linux-ld b/test/Driver/Inputs/prefixed_tools_tree/x86_64--linux-ld new file mode 100755 index 000000000000..d90113476e87 --- /dev/null +++ b/test/Driver/Inputs/prefixed_tools_tree/x86_64--linux-ld @@ -0,0 +1,2 @@ +#!/bin/sh +# This file must be executable to be picked up by GetProgramPath diff --git a/test/Driver/Inputs/suse_10.3_ppc64_tree/lib/.keep b/test/Driver/Inputs/suse_10.3_ppc64_tree/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/suse_10.3_ppc64_tree/lib/.keep diff --git a/test/Driver/Inputs/suse_10.3_ppc64_tree/lib64/.keep b/test/Driver/Inputs/suse_10.3_ppc64_tree/lib64/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/suse_10.3_ppc64_tree/lib64/.keep diff --git a/test/Driver/Inputs/suse_10.3_ppc64_tree/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64/crtbegin.o b/test/Driver/Inputs/suse_10.3_ppc64_tree/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64/crtbegin.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/suse_10.3_ppc64_tree/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64/crtbegin.o diff --git a/test/Driver/Inputs/suse_10.3_ppc64_tree/usr/lib/gcc/powerpc64-suse-linux/4.1.2/crtbegin.o b/test/Driver/Inputs/suse_10.3_ppc64_tree/usr/lib/gcc/powerpc64-suse-linux/4.1.2/crtbegin.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/suse_10.3_ppc64_tree/usr/lib/gcc/powerpc64-suse-linux/4.1.2/crtbegin.o diff --git a/test/Driver/Inputs/suse_10.3_ppc64_tree/usr/lib64/.keep b/test/Driver/Inputs/suse_10.3_ppc64_tree/usr/lib64/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/suse_10.3_ppc64_tree/usr/lib64/.keep diff --git a/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/lib/.keep b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/lib/.keep diff --git a/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/lib/i386-linux-gnu/.keep b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/lib/i386-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/lib/i386-linux-gnu/.keep diff --git a/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/.keep b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/.keep diff --git a/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/c++/4.5/.keep b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/c++/4.5/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/c++/4.5/.keep diff --git a/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/c++/4.5/backward/.keep b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/c++/4.5/backward/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/c++/4.5/backward/.keep diff --git a/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/c++/4.5/i686-linux-gnu/.keep b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/c++/4.5/i686-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/c++/4.5/i686-linux-gnu/.keep diff --git a/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/i386-linux-gnu/.keep b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/i386-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/include/i386-linux-gnu/.keep diff --git a/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/lib/.keep b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/lib/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/lib/.keep diff --git a/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/lib/i386-linux-gnu/.keep b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/lib/i386-linux-gnu/.keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/lib/i386-linux-gnu/.keep diff --git a/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/crtbegin.o b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/crtbegin.o new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test/Driver/Inputs/ubuntu_11.04_multiarch_tree/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/crtbegin.o diff --git a/test/Driver/Wp-args.c b/test/Driver/Wp-args.c index e072263c4f7a..0ab85b4c9c76 100644 --- a/test/Driver/Wp-args.c +++ b/test/Driver/Wp-args.c @@ -1,7 +1,7 @@ // Check that we extract -MD from '-Wp,-MD,FOO', which is used by a number of // major projects (e.g., FireFox and the Linux Kernel). -// RUN: %clang --ccc-host-triple i386-pc-linux-gnu -### \ +// RUN: %clang --target i386-pc-linux-gnu -### \ // RUN: -Wp,-MD,FOO.d -fsyntax-only %s 2> %t // RUN: FileCheck < %t %s // diff --git a/test/Driver/Xarch.c b/test/Driver/Xarch.c index b35bf6c92dff..2523f5acac01 100644 --- a/test/Driver/Xarch.c +++ b/test/Driver/Xarch.c @@ -1,9 +1,9 @@ -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -m32 -Xarch_i386 -O2 %s -S -### 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -O2 %s -S -### 2> %t.log // RUN: grep ' "-O2" ' %t.log | count 1 -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -m64 -Xarch_i386 -O2 %s -S -### 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -m64 -Xarch_i386 -O2 %s -S -### 2> %t.log // RUN: grep ' "-O2" ' %t.log | count 0 // RUN: grep "argument unused during compilation: '-Xarch_i386 -O2'" %t.log -// RUN: not %clang -ccc-host-triple i386-apple-darwin9 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2> %t.log +// RUN: not %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2> %t.log // RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -o'" %t.log | count 2 // RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -S'" %t.log diff --git a/test/Driver/Xlinker-args.c b/test/Driver/Xlinker-args.c index b009bffd5942..b4e5a9b08f43 100644 --- a/test/Driver/Xlinker-args.c +++ b/test/Driver/Xlinker-args.c @@ -1,7 +1,7 @@ // Check that we extract --no-demangle from '-Xlinker' and '-Wl,', since that // was a collect2 argument. -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### \ +// RUN: %clang -target i386-apple-darwin9 -### \ // RUN: -Xlinker one -Xlinker --no-demangle \ // RUN: -Wl,two,--no-demangle,three -Xlinker four %s 2> %t // RUN: FileCheck < %t %s diff --git a/test/Driver/altivec.cpp b/test/Driver/altivec.cpp new file mode 100644 index 000000000000..6059ad09e7c5 --- /dev/null +++ b/test/Driver/altivec.cpp @@ -0,0 +1,14 @@ +// Check that we error when -faltivec is specified on non-ppc platforms. + +// RUN: %clang -ccc-clang-archs powerpc -target powerpc-apple-darwin -faltivec -fsyntax-only %s +// RUN: %clang -ccc-clang-archs powerpc64 -target powerpc64-linux-gnu -faltivec -fsyntax-only %s + +// RUN: %clang -target i386-pc-win32 -faltivec -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clang -target x86_64-unknown-freebsd -faltivec -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clang -target armv6-apple-darwin -faltivec -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clang -target armv7-apple-darwin -faltivec -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clang -ccc-clang-archs mips -target mips-linux-gnu -faltivec -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clang -ccc-clang-archs mips64 -target mips64-linux-gnu -faltivec -fsyntax-only %s 2>&1 | FileCheck %s +// RUN: %clang -ccc-clang-archs sparc -target sparc-unknown-solaris -faltivec -fsyntax-only %s 2>&1 | FileCheck %s + +// CHECK: invalid argument '-faltivec' only allowed with 'ppc/ppc64' diff --git a/test/Driver/analyze.c b/test/Driver/analyze.c index 359b0e005b25..68fa218e8143 100644 --- a/test/Driver/analyze.c +++ b/test/Driver/analyze.c @@ -1,7 +1,7 @@ // Verify that the analyzer gets the same flags as normal compilation // (at least for a few key ones). -// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 %clang -ccc-host-triple i386-apple-darwin9 -### --analyze -o /dev/null %s -msse 2> %t.log +// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 %clang -target i386-apple-darwin9 -### --analyze -o /dev/null %s -msse 2> %t.log // RUN: FileCheck --input-file=%t.log %s // CHECK: "-analyze" diff --git a/test/Driver/apple-kext-i386.cpp b/test/Driver/apple-kext-i386.cpp index 8ce9f87dab38..c11a1361a1a3 100644 --- a/test/Driver/apple-kext-i386.cpp +++ b/test/Driver/apple-kext-i386.cpp @@ -1,29 +1,29 @@ // Check that we transparently fallback to llvm-gcc for i386 kexts, we don't // support the ABI they use (yet). -// RUN: %clang -ccc-host-triple i386-apple-darwin10 \ +// RUN: %clang -target i386-apple-darwin10 \ // RUN: -fapple-kext -### -fsyntax-only %s 2> %t // RUN: FileCheck --check-prefix=CHECK < %t %s // CHECK: cc1plus" // CHECK: "-fapple-kext" -// RUN: %clang -ccc-host-triple i386-apple-darwin10 \ +// RUN: %clang -target i386-apple-darwin10 \ // RUN: -mkernel -### -fsyntax-only %s 2> %t // RUN: FileCheck --check-prefix=CHECK-MKERNEL < %t %s // CHECK-MKERNEL: cc1plus" // CHECK-MKERNEL: "-mkernel" -// RUN: %clang -ccc-host-triple i386-apple-darwin10 \ -// RUN: -Wno-self-assign -Wc++0x-extensions -Wno-microsoft -Wmicrosoft -Wvla \ +// RUN: %clang -target i386-apple-darwin10 \ +// RUN: -Wno-self-assign -Wc++11-extensions -Wno-microsoft -Wmicrosoft -Wvla \ // RUN: -faltivec -mthumb -mcpu=G4 -mlongcall -mno-longcall -msoft-float \ // RUN: -fapple-kext -### -fsyntax-only %s 2> %t // RUN: FileCheck --check-prefix=CHECK-UNSUPPORTED < %t %s // CHECK-UNSUPPORTED: cc1plus" // CHECK-UNSUPPORTED-NOT: "-Wno-self-assign" -// CHECK-UNSUPPORTED-NOT: "-Wc++0x-extensions" +// CHECK-UNSUPPORTED-NOT: "-Wc++11-extensions" // CHECK-UNSUPPORTED-NOT: "-Wno-microsoft" // CHECK-UNSUPPORTED-NOT: "-Wmicrosoft" // CHECK-UNSUPPORTED-NOT: "-Wvla" @@ -33,10 +33,18 @@ // CHECK-UNSUPPORTED: "-mno-longcall" // CHECK-UNSUPPORTED: "-msoft-float" -// RUN: %clang -ccc-host-triple i386-apple-darwin10 \ +// RUN: %clang -target i386-apple-darwin10 \ // RUN: -Wconstant-logical-operand -save-temps \ // RUN: -fapple-kext -### -fsyntax-only %s 2> %t // RUN: FileCheck --check-prefix=CHECK-UNSUPPORTED2 < %t %s // CHECK-UNSUPPORTED2: cc1plus" // CHECK-UNSUPPORTED2-NOT: "-Wconstant-logical-operand" + +// Check that --serialize-diagnostics does not cause an "argument unused" error. +// RUN: %clang -target i386-apple-darwin10 \ +// RUN: -Wall -fapple-kext -### --serialize-diagnostics %t.dia -c %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-UNUSED %s + +// CHECK-UNUSED-NOT: argument unused +// CHECK-UNUSED: cc1plus diff --git a/test/Driver/apple-kext-mkernel.c b/test/Driver/apple-kext-mkernel.c index 82a6896415c2..f8b7b90844a5 100644 --- a/test/Driver/apple-kext-mkernel.c +++ b/test/Driver/apple-kext-mkernel.c @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 \ +// RUN: %clang -target x86_64-apple-darwin10 \ // RUN: -mkernel -### -fsyntax-only %s 2> %t // RUN: FileCheck --check-prefix=CHECK-X86 < %t %s @@ -7,7 +7,7 @@ // CHECK-X86: "-fno-rtti" // CHECK-X86: "-fno-common" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 \ +// RUN: %clang -target x86_64-apple-darwin10 \ // RUN: -arch armv7 -mkernel -### -fsyntax-only %s 2> %t // RUN: FileCheck --check-prefix=CHECK-ARM < %t %s @@ -16,3 +16,7 @@ // CHECK-ARM: "-fno-builtin" // CHECK-ARM: "-fno-rtti" // CHECK-ARM: "-fno-common" + +// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: -Werror -fno-builtin -fno-exceptions -fno-common -fno-rtti \ +// RUN: -mkernel -fsyntax-only %s diff --git a/test/Driver/arc.c b/test/Driver/arc.c index a4d4ed1c6043..f2c1127116a0 100644 --- a/test/Driver/arc.c +++ b/test/Driver/arc.c @@ -1,8 +1,9 @@ -// RUN: %clang -ObjC -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s -// RUN: %clang -x objective-c -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s -// RUN: %clang -x objective-c++ -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s -// RUN: %clang -x c -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s -// RUN: %clang -x c++ -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s +// RUN: %clang -ObjC -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s +// RUN: %clang -x objective-c -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s +// RUN: %clang -x objective-c++ -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s +// RUN: %clang -x c -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s +// RUN: %clang -x c++ -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s +// RUN: %clang -x objective-c -target x86_64-apple-darwin11 -mmacosx-version-min=10.5 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix UNSUPPORTED %s // Just to test clang is working. # foo @@ -12,3 +13,5 @@ // NOTOBJC-NOT: error: -fobjc-arc is not supported with fragile abi // NOTOBJC: invalid preprocessing directive + +// UNSUPPORTED: error: -fobjc-arc is not supported on current deployment target diff --git a/test/Driver/arch.c b/test/Driver/arch.c index 69693ee0a3cb..df9a3e10e02e 100644 --- a/test/Driver/arch.c +++ b/test/Driver/arch.c @@ -1,3 +1,3 @@ -// RUN: %clang -ccc-host-triple armv7a-unknown-linux-gnueabi -S -emit-llvm %s -o - | FileCheck %s +// RUN: %clang -target armv7a-unknown-linux-gnueabi -S -emit-llvm %s -o - | FileCheck %s // CHECK: target triple = "armv7-unknown-linux-gnueabi" diff --git a/test/Driver/arclite-link.c b/test/Driver/arclite-link.c new file mode 100644 index 000000000000..9cf1efe987ca --- /dev/null +++ b/test/Driver/arclite-link.c @@ -0,0 +1,8 @@ +// RUN: touch %t.o +// RUN: %clang -### -target x86_64-apple-darwin10 -fobjc-link-runtime -mmacosx-version-min=10.7 %t.o 2>&1 | FileCheck -check-prefix=CHECK-ARCLITE-OSX %s +// RUN: %clang -### -target x86_64-apple-darwin10 -fobjc-link-runtime -mmacosx-version-min=10.8 %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOARCLITE %s +// RUN: %clang -### -target i386-apple-darwin10 -fobjc-link-runtime -mmacosx-version-min=10.7 %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOARCLITE %s + +// CHECK-ARCLITE-OSX: libarclite_macosx.a +// CHECK-ARCLITE-OSX: -lobjc +// CHECK-NOARCLITE-NOT: libarclite diff --git a/test/Driver/arm-darwin-builtin.c b/test/Driver/arm-darwin-builtin.c index 9d4cee0f05e3..41f13f3f7c23 100644 --- a/test/Driver/arm-darwin-builtin.c +++ b/test/Driver/arm-darwin-builtin.c @@ -1,14 +1,14 @@ // FIXME: Disable pending PR4941. -// RUX: clang -ccc-host-triple x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s 2> %t && +// RUX: clang -target x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s 2> %t && // RUX: grep -- "-fno-builtin-strcat" %t && // RUX: grep -- "-fno-builtin-strcpy" %t && // FIXME: Disable pending PR4941. -// RUX: clang -ccc-host-triple x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t && +// RUX: clang -target x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t && // RUX: not grep -- "-fno-builtin-strcat" %t && // RUX: not grep -- "-fno-builtin-strcpy" %t && -// RUN: %clang -ccc-no-clang -ccc-host-triple x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t +// RUN: %clang -ccc-no-clang -target x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t // RUN: not grep -- "-fno-builtin-strcat" %t // RUN: not grep -- "-fno-builtin-strcpy" %t diff --git a/test/Driver/arm-mfpmath.c b/test/Driver/arm-mfpmath.c new file mode 100644 index 000000000000..0421046c5bc8 --- /dev/null +++ b/test/Driver/arm-mfpmath.c @@ -0,0 +1,29 @@ +// Test different values of -mfpmath. + +// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp %s -### -c -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-VFP %s +// CHECK-VFP: "-target-feature" "-neonfp" + +// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp2 %s -### -c -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-VFP2 %s +// CHECK-VFP2: "-target-feature" "-neonfp" + +// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp3 %s -### -c -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s +// CHECK-VFP3: "-target-feature" "-neonfp" + +// RUN: %clang -target arm-apple-darwin10 -mfpmath=vfp4 %s -### -c -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-VFP4 %s +// CHECK-VFP4: "-target-feature" "-neonfp" + +// RUN: %clang -target arm-apple-darwin10 -mfpmath=neon %s -### -c -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NEON %s +// CHECK-NEON: "-target-feature" "+neonfp" + +// RUN: %clang -target arm-apple-darwin10 -mfpmath=foo %s -### -c -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ERROR %s +// CHECK-ERROR: clang compiler does not support '-mfpmath=foo' + +// RUN: %clang -target arm-apple-darwin10 -mcpu=arm1136j-s -mfpmath=neon %s -### -c -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MCPU-ERROR %s +// CHECK-MCPU-ERROR: error: invalid feature '-mfpmath=neon' for CPU 'arm1136j-s' diff --git a/test/Driver/arm-mfpu.c b/test/Driver/arm-mfpu.c new file mode 100644 index 000000000000..f51c41ed3f8a --- /dev/null +++ b/test/Driver/arm-mfpu.c @@ -0,0 +1,48 @@ +// Test that different values of -mfpu pick correct ARM FPU target-feature(s). + +// RUN: %clang -target arm-linux-eabi %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s +// CHECK-DEFAULT-NOT: "-target-feature" "+vfp2" +// CHECK-DEFAULT-NOT: "-target-feature" "+vfp3" +// CHECK-DEFAULT-NOT: "-target-feature" "+d16" +// CHECK-DEFAULT-NOT: "-target-feature" "+neon" + +// RUN: %clang -target arm-linux-eabi -mfpu=fpa %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FPA %s +// RUN: %clang -target arm-linux-eabi -mfpu=fpe2 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FPA %s +// RUN: %clang -target arm-linux-eabi -mfpu=fpe3 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FPA %s +// RUN: %clang -target arm-linux-eabi -mfpu=maverick %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FPA %s +// CHECK-FPA: "-target-feature" "-vfp2" +// CHECK-FPA: "-target-feature" "-vfp3" +// CHECK-FPA: "-target-feature" "-neon" + +// RUN: %clang -target arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s +// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s +// CHECK-VFP3-D16: "-target-feature" "+vfp3" +// CHECK-VFP3-D16: "-target-feature" "+d16" +// CHECK-VFP3-D16: "-target-feature" "-neon" + +// RUN: %clang -target arm-linux-eabi -mfpu=vfp %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-VFP %s +// CHECK-VFP: "-target-feature" "+vfp2" +// CHECK-VFP: "-target-feature" "-neon" + +// RUN: %clang -target arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s +// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s +// CHECK-VFP3: "-target-feature" "+vfp3" +// CHECK-VFP3: "-target-feature" "-neon" + +// RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NEON %s +// CHECK-NEON: "-target-feature" "+neon" + +// RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s +// CHECK-SOFT-FLOAT: "-target-feature" "-neon" diff --git a/test/Driver/asan.c b/test/Driver/asan.c new file mode 100644 index 000000000000..4c9a1b6c4423 --- /dev/null +++ b/test/Driver/asan.c @@ -0,0 +1,8 @@ +// RUN: %clang -target i386-unknown-unknown -faddress-sanitizer %s -S -emit-llvm -o - | FileCheck %s +// RUN: %clang -O1 -target i386-unknown-unknown -faddress-sanitizer %s -S -emit-llvm -o - | FileCheck %s +// RUN: %clang -O2 -target i386-unknown-unknown -faddress-sanitizer %s -S -emit-llvm -o - | FileCheck %s +// RUN: %clang -O3 -target i386-unknown-unknown -faddress-sanitizer %s -S -emit-llvm -o - | FileCheck %s +// Verify that -faddress-sanitizer invokes asan instrumentation. + +int foo(int *a) { return *a; } +// CHECK: __asan_init diff --git a/test/Driver/ast.c b/test/Driver/ast.c index e9fbb068d969..83dfcc37a9c8 100644 --- a/test/Driver/ast.c +++ b/test/Driver/ast.c @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -emit-ast %s 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -emit-ast %s 2> %t // RUN: echo 'END' >> %t // RUN: FileCheck -check-prefix EMIT-AST-PHASES -input-file %t %s @@ -10,7 +10,7 @@ // EMIT-AST-PHASES: END // RUN: touch %t.ast -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.ast 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -c %t.ast 2> %t // RUN: echo 'END' >> %t // RUN: FileCheck -check-prefix COMPILE-AST-PHASES -input-file %t %s diff --git a/test/Driver/bindings.c b/test/Driver/bindings.c index b825420b7151..a7cda19bcb3f 100644 --- a/test/Driver/bindings.c +++ b/test/Driver/bindings.c @@ -1,48 +1,48 @@ // Basic binding. -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings %s 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings %s 2> %t // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: ".*\.s"' %t // RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t // RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang %s 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang %s 2> %t // RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: ".*\.s"' %t // RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t // RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -no-integrated-cpp %s 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -no-integrated-cpp %s 2> %t // RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: ".*\.i"' %t // RUN: grep '"gcc::Compile", inputs: \[".*\.i"\], output: ".*\.s"' %t // RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t // RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -x c-header %s 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -x c-header %s 2> %t // RUN: grep '"gcc::Precompile", inputs: \[".*bindings.c"\], output: ".*bindings.c.gch' %t // Clang control options -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -fsyntax-only %s 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -fsyntax-only %s 2> %t // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: (nothing)' %t -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -fsyntax-only %s 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -fsyntax-only %s 2> %t // RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: (nothing)' %t -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cxx -fsyntax-only -x c++ %s 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cxx -fsyntax-only -x c++ %s 2> %t // RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: (nothing)' %t -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-clang-cxx -fsyntax-only -x c++ %s 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-clang-cxx -fsyntax-only -x c++ %s 2> %t // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: (nothing)' %t -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cpp -fsyntax-only -no-integrated-cpp %s 2> %t +// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cpp -fsyntax-only -no-integrated-cpp %s 2> %t // RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: ".*\.i"' %t // RUN: grep '"clang", inputs: \[".*\.i"\], output: (nothing)' %t -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs i386 %s -S -arch ppc 2> %t +// RUN: %clang -target i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs i386 %s -S -arch ppc 2> %t // RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs powerpc %s -S -arch ppc 2> %t +// RUN: %clang -target i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs powerpc %s -S -arch ppc 2> %t // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t -// RUN: %clang -ccc-host-triple powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "" %s -S 2> %t +// RUN: %clang -target powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "" %s -S 2> %t // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t -// RUN: %clang -ccc-host-triple powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "i386" %s -S 2> %t +// RUN: %clang -target powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "i386" %s -S 2> %t // RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t // Darwin bindings -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -no-integrated-as -ccc-print-bindings %s 2> %t +// RUN: %clang -target i386-apple-darwin9 -no-integrated-as -ccc-print-bindings %s 2> %t // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: ".*\.s"' %t // RUN: grep '"darwin::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t // RUN: grep '"darwin::Link", inputs: \[".*\.o"\], output: "a.out"' %t diff --git a/test/Driver/cc-log-diagnostics.c b/test/Driver/cc-log-diagnostics.c index 2fdbe5133c5b..88c99f580de3 100644 --- a/test/Driver/cc-log-diagnostics.c +++ b/test/Driver/cc-log-diagnostics.c @@ -1,7 +1,7 @@ // RUN: rm -f %t.log // RUN: env RC_DEBUG_OPTIONS=1 \ // RUN: CC_LOG_DIAGNOSTICS=1 CC_LOG_DIAGNOSTICS_FILE=%t.log \ -// RUN: %clang -Wfoobar -no-canonical-prefixes -ccc-host-triple x86_64-apple-darwin10 -fsyntax-only %s +// RUN: %clang -Wfoobar -no-canonical-prefixes -target x86_64-apple-darwin10 -fsyntax-only %s // RUN: FileCheck %s < %t.log int f0() {} @@ -17,7 +17,7 @@ int f0() {} // CHECK: <key>level</key> // CHECK: <string>warning</string> // CHECK: <key>message</key> -// CHECK: <string>unknown warning option '-Wfoobar'</string> +// CHECK: <string>unknown warning option '-Wfoobar'; did you mean '-W{{.*}}'?</string> // CHECK: </dict> // CHECK: <dict> // CHECK: <key>level</key> diff --git a/test/Driver/ccc-host-triple-no-integrated-as.c b/test/Driver/ccc-host-triple-no-integrated-as.c index a94dea3a7da2..1677b717f70b 100644 --- a/test/Driver/ccc-host-triple-no-integrated-as.c +++ b/test/Driver/ccc-host-triple-no-integrated-as.c @@ -1,9 +1,9 @@ -// Check that -no-integrated-as works when -ccc-host-triple i386-pc-win32-macho or -// -ccc-host-triple x86_64-pc-win32-macho is specified. +// Check that -no-integrated-as works when -target i386-pc-win32-macho or +// -target x86_64-pc-win32-macho is specified. -// RUN: %clang -### -c -ccc-host-triple i386-pc-win32-macho -no-integrated-as %s 2> %t1 +// RUN: %clang -### -c -target i386-pc-win32-macho -no-integrated-as %s 2> %t1 // RUN: FileCheck -check-prefix=X86 < %t1 %s -// RUN: %clang -### -c -ccc-host-triple x86_64-pc-win32-macho -no-integrated-as %s 2> %t2 +// RUN: %clang -### -c -target x86_64-pc-win32-macho -no-integrated-as %s 2> %t2 // RUN: FileCheck -check-prefix=X86_64 < %t2 %s // // X86: "-cc1" diff --git a/test/Driver/cfi.c b/test/Driver/cfi.c index b5c0c03e7a49..c33d19042861 100644 --- a/test/Driver/cfi.c +++ b/test/Driver/cfi.c @@ -1,7 +1,8 @@ -// RUN: %clang -ccc-host-triple i386-apple-darwin10 -static -### %s 2>&1 | \ +// RUN: %clang -target i386-apple-darwin10 \ +// RUN: -no-integrated-as -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-DARWIN %s -// RUN: %clang -ccc-host-triple i386-pc-linux-gnu -static -### %s 2>&1 | \ +// RUN: %clang -target i386-pc-linux-gnu -static -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-LINUX %s // CHECK-DARWIN: -fno-dwarf2-cfi-asm diff --git a/test/Driver/clang-translation.c b/test/Driver/clang-translation.c index b2b358f0ebb8..0e82de4af3e4 100644 --- a/test/Driver/clang-translation.c +++ b/test/Driver/clang-translation.c @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-host-triple i386-unknown-unknown -### -S -O0 -Os %s -o %t.s -fverbose-asm -funwind-tables -fvisibility=hidden 2> %t.log +// RUN: %clang -target i386-unknown-unknown -### -S -O0 -Os %s -o %t.s -fverbose-asm -funwind-tables -fvisibility=hidden 2> %t.log // RUN: grep '"-triple" "i386-unknown-unknown"' %t.log // RUN: grep '"-S"' %t.log // RUN: grep '"-disable-free"' %t.log @@ -9,12 +9,12 @@ // RUN: grep '"-o" .*clang-translation.*' %t.log // RUN: grep '"-masm-verbose"' %t.log // RUN: grep '"-fvisibility" "hidden"' %t.log -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -S %s -o %t.s 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -S %s -o %t.s 2> %t.log // RUN: grep '"-target-cpu" "yonah"' %t.log -// RUN: %clang -ccc-host-triple x86_64-apple-darwin9 -### -S %s -o %t.s 2> %t.log +// RUN: %clang -target x86_64-apple-darwin9 -### -S %s -o %t.s 2> %t.log // RUN: grep '"-target-cpu" "core2"' %t.log -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \ +// RUN: %clang -target x86_64-apple-darwin10 -### -S %s 2> %t.log \ // RUN: -arch armv7 // RUN: FileCheck -check-prefix=ARMV7_DEFAULT %s < %t.log // ARMV7_DEFAULT: clang @@ -24,7 +24,7 @@ // ARMV7_DEFAULT-NOT: "-msoft-float" // ARMV7_DEFAULT: "-x" "c" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \ +// RUN: %clang -target x86_64-apple-darwin10 -### -S %s 2> %t.log \ // RUN: -arch armv7 -msoft-float // RUN: FileCheck -check-prefix=ARMV7_SOFTFLOAT %s < %t.log // ARMV7_SOFTFLOAT: clang @@ -35,7 +35,7 @@ // ARMV7_SOFTFLOAT: "-neon" // ARMV7_SOFTFLOAT: "-x" "c" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \ +// RUN: %clang -target x86_64-apple-darwin10 -### -S %s 2> %t.log \ // RUN: -arch armv7 -mhard-float // RUN: FileCheck -check-prefix=ARMV7_HARDFLOAT %s < %t.log // ARMV7_HARDFLOAT: clang diff --git a/test/Driver/cpath.c b/test/Driver/cpath.c index 7caa014b2afc..bd7c8d0ab5f0 100644 --- a/test/Driver/cpath.c +++ b/test/Driver/cpath.c @@ -1,20 +1,22 @@ -// RUN: mkdir -p %T/test1 %T/test2 +// RUN: mkdir -p %T/test1 %T/test2 %T/test3 -// RUN: env CPATH=%T/test1 %clang -x c -E -v %s 2>&1 | FileCheck %s -check-prefix=CPATH +// RUN: env "CPATH=%T/test1%{pathsep}%T/test2" %clang -x c -E -v %s 2>&1 | FileCheck %s -check-prefix=CPATH // CPATH: -I {{.*}}/test1 +// CPATH: -I {{.*}}/test2 // CPATH: search starts here // CPATH: test1 +// CPATH: test2 -// RUN: env OBJC_INCLUDE_PATH=%T/test1 OBJCPLUS_INCLUDE_PATH=%T/test1 CPLUS_INCLUDE_PATH=%T/test1 C_INCLUDE_PATH=%T/test2 %clang -x c -E -v %s 2>&1 | FileCheck %s -check-prefix=C_INCLUDE_PATH -// C_INCLUDE_PATH: -c-isystem {{"?.*}}/test2{{"?}} -cxx-isystem {{"?.*}}/test1{{"?}} -objc-isystem {{"?.*}}/test1{{"?}} -objcxx-isystem {{"?.*}}/test1{{"?}} +// RUN: env "OBJC_INCLUDE_PATH=%T/test1%{pathsep}%T/test2" OBJCPLUS_INCLUDE_PATH=%T/test1 "CPLUS_INCLUDE_PATH=%T/test1%{pathsep}%t/test2" C_INCLUDE_PATH=%T/test3 %clang -x c -E -v %s 2>&1 | FileCheck %s -check-prefix=C_INCLUDE_PATH +// C_INCLUDE_PATH: -c-isystem {{"?.*}}/test3{{"?}} -cxx-isystem {{"?.*}}/test1{{"?}} -cxx-isystem {{"?.*}}/test2{{"?}} -objc-isystem {{"?.*}}/test1{{"?}} -objc-isystem {{"?.*}}/test2{{"?}} -objcxx-isystem {{"?.*}}/test1{{"?}} // C_INCLUDE_PATH: search starts here // C_INCLUDE_PATH-NOT: test1 -// C_INCLUDE_PATH: test2 +// C_INCLUDE_PATH: test3 // C_INCLUDE_PATH-NOT: test1 -// RUN: env OBJC_INCLUDE_PATH=%T/test1 OBJCPLUS_INCLUDE_PATH=%T/test2 CPLUS_INCLUDE_PATH=%T/test2 C_INCLUDE_PATH=%T/test1 %clang -x objective-c++ -E -v %s 2>&1 | FileCheck %s -check-prefix=OBJCPLUS_INCLUDE_PATH -// OBJCPLUS_INCLUDE_PATH: -c-isystem {{"?.*}}/test1{{"?}} -cxx-isystem {{"?.*}}/test2{{"?}} -objc-isystem {{"?.*}}/test1{{"?}} -objcxx-isystem {{"?.*}}/test2{{"?}} +// RUN: env OBJC_INCLUDE_PATH=%T/test1 OBJCPLUS_INCLUDE_PATH=%T/test3 CPLUS_INCLUDE_PATH=%T/test3 C_INCLUDE_PATH=%T/test1 %clang -x objective-c++ -E -v %s 2>&1 | FileCheck %s -check-prefix=OBJCPLUS_INCLUDE_PATH +// OBJCPLUS_INCLUDE_PATH: -c-isystem {{"?.*}}/test1{{"?}} -cxx-isystem {{"?.*}}/test3{{"?}} -objc-isystem {{"?.*}}/test1{{"?}} -objcxx-isystem {{"?.*}}/test3{{"?}} // OBJCPLUS_INCLUDE_PATH: search starts here // OBJCPLUS_INCLUDE_PATH-NOT: test1 -// OBJCPLUS_INCLUDE_PATH: test2 +// OBJCPLUS_INCLUDE_PATH: test3 // OBJCPLUS_INCLUDE_PATH-NOT: test1 diff --git a/test/Driver/cpp-precomp.c b/test/Driver/cpp-precomp.c new file mode 100644 index 000000000000..a384a35dd90b --- /dev/null +++ b/test/Driver/cpp-precomp.c @@ -0,0 +1,5 @@ +// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: -Werror -cpp-precomp -fsyntax-only %s + +// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: -Werror -no-cpp-precomp -fsyntax-only %s diff --git a/test/Driver/darwin-as.c b/test/Driver/darwin-as.c index 7d4cdbfcd379..92c76414a72b 100644 --- a/test/Driver/darwin-as.c +++ b/test/Driver/darwin-as.c @@ -1,16 +1,17 @@ -// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -x assembler -c %s -static -dynamic 2>%t +// RUN: %clang -target i386-apple-darwin10 -### -x assembler -c %s \ +// RUN: -no-integrated-as -static -dynamic 2>%t // RUN: FileCheck -check-prefix=STATIC_AND_DYNAMIC-32 --input-file %t %s // // CHECK-STATIC_AND_DYNAMIC-32: as{{(.exe)?}}" "-arch" "i386" "-force_cpusubtype_ALL" "-static" "-o" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -x assembler -c %s -static 2>%t +// RUN: %clang -target x86_64-apple-darwin10 -### -x assembler -c %s \ +// RUN: -no-integrated-as -static 2>%t // RUN: FileCheck -check-prefix=STATIC-64 --input-file %t %s // // CHECK-STATIC-64: as{{(.exe)?}}" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \ -// RUN: -arch armv6 -x assembler -c %s 2>%t +// RUN: %clang -target x86_64-apple-darwin10 -### \ +// RUN: -arch armv6 -no-integrated-as -x assembler -c %s 2>%t // RUN: FileCheck -check-prefix=ARMV6 --input-file %t %s // // CHECK-ARMV6: as{{(.exe)?}}" "-arch" "armv6" "-o" - diff --git a/test/Driver/darwin-cc.c b/test/Driver/darwin-cc.c index 247b02bebea2..85cdf12fb19f 100644 --- a/test/Driver/darwin-cc.c +++ b/test/Driver/darwin-cc.c @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-no-clang -ccc-host-triple i386-apple-darwin10 -m32 -### -MD -g -fast -Q -dA -mkernel -ansi -aFOO -S -o /tmp/OUTPUTNAME -g0 -gfull -O2 -Werror -pedantic -Wmost -w -std=c99 -trigraphs -v -pg -fFOO -undef -Qn --param a=b -fmudflap -coverage -save-temps -nostdinc -I ARG0 -F ARG1 -I ARG2 -P -MF ARG3 -MG -MP -remap -g3 -H -D ARG4 -U ARG5 -A ARG6 -D ARG7 -U ARG8 -A ARG9 -include ARG10 -pthread %s 2> %t.log +// RUN: %clang -ccc-no-clang -target i386-apple-darwin10 -m32 -### -MD -g -fast -Q -dA -mkernel -ansi -aFOO -S -o /tmp/OUTPUTNAME -g0 -gfull -O2 -Werror -pedantic -Wmost -w -std=c99 -trigraphs -v -pg -fFOO -undef -Qn --param a=b -fmudflap -coverage -save-temps -nostdinc -I ARG0 -F ARG1 -I ARG2 -P -MF ARG3 -MG -MP -remap -g3 -H -D ARG4 -U ARG5 -A ARG6 -D ARG7 -U ARG8 -A ARG9 -include ARG10 -pthread %s 2> %t.log // RUN: FileCheck %s < %t.log // CHECK: {{ ".*cc1.*" "-E" "-nostdinc" "-v" "-I" "ARG0" "-FARG1" "-I" "ARG2" "-P" "-MD" "[^"]*/OUTPUTNAME.d" "-MF" "ARG3" "-MG" "-MP" "-MQ" "[^"]*/OUTPUTNAME" "-remap" "-dD" "-H" "-D__STATIC__" "-D_REENTRANT" "-D" "ARG4" "-U" "ARG5" "-A" "ARG6" "-D" "ARG7" "-U" "ARG8" "-A" "ARG9" "-include" "ARG10" ".*darwin-cc.c" "-D_MUDFLAP" "-include" "mf-runtime.h" "-m32" "-mkernel" "-mtune=core2" "-mmacosx-version-min=10.6.0" "-ansi" "-std=c99" "-trigraphs" "-Werror" "-pedantic" "-Wmost" "-w" "-fast" "-fno-eliminate-unused-debug-symbols" "-fFOO" "-fmudflap" "-O2" "-undef" "-fpch-preprocess" "-o" ".*darwin-cc.i"}} // CHECK: {{ ".*cc1.*" "-fpreprocessed" ".*darwin-cc.i" "-O3" "-dumpbase" ".*darwin-cc.c" "-dA" "-m32" "-mkernel" "-mtune=core2" "-mmacosx-version-min=10.6.0" "-ansi" "-aFOO" "-auxbase-strip" "[^"]*/OUTPUTNAME" "-g" "-g0" "-g" "-g3" "-O2" "-Werror" "-pedantic" "-Wmost" "-w" "-ansi" "-std=c99" "-trigraphs" "-version" "-p" "-fast" "-fno-eliminate-unused-debug-symbols" "-fFOO" "-fmudflap" "-undef" "-fno-ident" "-o" "[^"]*/OUTPUTNAME" "--param" "a=b" "-fno-builtin" "-fno-merge-constants" "-fprofile-arcs" "-ftest-coverage"}} diff --git a/test/Driver/darwin-debug-flags.c b/test/Driver/darwin-debug-flags.c index 326ca47411a3..baf28475f8e8 100644 --- a/test/Driver/darwin-debug-flags.c +++ b/test/Driver/darwin-debug-flags.c @@ -1,5 +1,7 @@ -// RUN: env RC_DEBUG_OPTIONS=1 %clang -ccc-host-triple i386-apple-darwin9 -g -Os %s -emit-llvm -S -o - | FileCheck %s +// RUN: env RC_DEBUG_OPTIONS=1 %clang -target i386-apple-darwin9 -g -Os %s -emit-llvm -S -o - | FileCheck %s // <rdar://problem/7256886> +// RUN: touch %t.s +// RUN: env RC_DEBUG_OPTIONS=1 %clang -### -target i386-apple-darwin9 -c -g %t.s 2>&1 | FileCheck -check-prefix=S %s // CHECK: !0 = metadata !{ // CHECK: -g -Os @@ -7,3 +9,5 @@ // CHECK: [ DW_TAG_compile_unit ] int x; + +// S: "-dwarf-debug-flags" diff --git a/test/Driver/darwin-dsymutil.c b/test/Driver/darwin-dsymutil.c index afb41a9db28b..440986639a0a 100644 --- a/test/Driver/darwin-dsymutil.c +++ b/test/Driver/darwin-dsymutil.c @@ -1,6 +1,6 @@ // Check that we run dsymutil properly with multiple -arch options. // -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-phases \ +// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \ // RUN: -arch i386 -arch x86_64 %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s // @@ -14,7 +14,7 @@ // CHECK-MULTIARCH-ACTIONS: 7: lipo, {5, 6}, image // CHECK-MULTIARCH-ACTIONS: 8: dsymutil, {7}, dSYM // -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ // RUN: -arch i386 -arch x86_64 %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s // @@ -23,7 +23,7 @@ // Check output name derivation. // -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ // RUN: -o foo %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-OUTPUT-NAME < %t %s // @@ -33,12 +33,12 @@ // Check that we only use dsymutil when needed. // // RUN: touch %t.o -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ // RUN: -o foo %t.o -g 2> %t // RUN: grep "Dsymutil" %t | count 0 // Check that we put the .dSYM in the right place. -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ // RUN: -o bar/foo %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-LOCATION < %t %s diff --git a/test/Driver/darwin-iphone-defaults.m b/test/Driver/darwin-iphone-defaults.m index 62a940390013..bba0cc0869e0 100644 --- a/test/Driver/darwin-iphone-defaults.m +++ b/test/Driver/darwin-iphone-defaults.m @@ -1,8 +1,6 @@ -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -miphoneos-version-min=3.0 -arch armv7 -flto -S -o - %s | FileCheck %s +// RUN: %clang -target i386-apple-darwin9 -miphoneos-version-min=3.0 -arch armv7 -flto -S -o - %s | FileCheck %s -// CHECK: @f0 -// CHECK-NOT: ssp -// CHECK: ) { +// CHECK: @f0() ssp // CHECK: @__f0_block_invoke // CHECK: void @f1 // CHECK-NOT: msgSend_fixup_alloc diff --git a/test/Driver/darwin-ld.c b/test/Driver/darwin-ld.c index 33b48583b5e9..3206f654d5c0 100644 --- a/test/Driver/darwin-ld.c +++ b/test/Driver/darwin-ld.c @@ -1,32 +1,19 @@ // Check that ld gets arch_multiple. -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -arch i386 -arch x86_64 %s -### -o foo 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -arch i386 -arch x86_64 %s -### -o foo 2> %t.log // RUN: grep '".*ld.*" .*"-arch_multiple" "-final_output" "foo"' %t.log // Make sure we run dsymutil on source input files. -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -g %s -o BAR 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -g %s -o BAR 2> %t.log // RUN: grep '".*dsymutil" "-o" "BAR.dSYM" "BAR"' %t.log -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log // RUN: grep '".*dsymutil" "-o" "BAR.dSYM" "BAR"' %t.log -// Splatter test case. This is gross, but it works for now. For the -// driver, just getting coverage of the tool code and checking the -// output options is nearly good enough. The main thing we are -// protecting against here is unintended changes in the driver -// output. Intended changes should add more reasonable test cases, and -// just update this test to match the expected behavior. -// -// Note that at conception, this exactly matches gcc. - -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -A ARG0 -F ARG1 -L ARG2 -Mach -T ARG4 -X -Z -all_load -allowable_client ARG8 -bind_at_load -compatibility_version ARG11 -current_version ARG12 -d -dead_strip -dylib_file ARG14 -dylinker -dylinker_install_name ARG16 -dynamic -dynamiclib -e ARG19 -exported_symbols_list ARG20 -fexceptions -flat_namespace -fnested-functions -fopenmp -force_cpusubtype_ALL -force_load ARG28 -fpie -fprofile-arcs -headerpad_max_install_names -image_base ARG29 -init ARG30 -install_name ARG31 -m ARG33 -mmacosx-version-min=10.3.2 -multi_module -multiply_defined ARG37 -multiply_defined_unused ARG38 -no_dead_strip_inits_and_terms -nodefaultlibs -nofixprebinding -nomultidefs -noprebind -noseglinkedit -nostartfiles -nostdlib -pagezero_size ARG54 -pg -prebind -prebind_all_twolevel_modules -preload -r -read_only_relocs ARG55 -s -sectalign ARG57_0 ARG57_1 ARG57_2 -sectcreate ARG58_0 ARG58_1 ARG58_2 -sectobjectsymbols ARG59_0 ARG59_1 -sectorder ARG60_0 ARG60_1 ARG60_2 -seg1addr ARG61 -seg_addr_table ARG62 -seg_addr_table_filename ARG63 -segaddr ARG64_0 ARG64_1 -segcreate ARG65_0 ARG65_1 ARG65_2 -seglinkedit -segprot ARG67_0 ARG67_1 ARG67_2 -segs_read_FOO -segs_read_only_addr ARG69 -segs_read_write_addr ARG70 -shared-libgcc -single_module -static -static-libgcc -sub_library ARG77 -sub_umbrella ARG78 -t -twolevel_namespace -twolevel_namespace_hints -u ARG82 -umbrella ARG83 -undefined ARG84 -unexported_symbols_list ARG85 -w -weak_reference_mismatches ARG87 -whatsloaded -whyload -y -filelist FOO -l FOO 2> %t.log -// RUN: FileCheck -check-prefix=SPLATTER %s < %t.log -// SPLATTER: {{".*ld.*" "-static" "-dylib" "-dylib_compatibility_version" "ARG11" "-dylib_current_version" "ARG12" "-arch" "i386" "-dylib_install_name" "ARG31" "-all_load" "-allowable_client" "ARG8" "-bind_at_load" "-dead_strip" "-no_dead_strip_inits_and_terms" "-dylib_file" "ARG14" "-dynamic" "-exported_symbols_list" "ARG20" "-flat_namespace" "-force_load" "ARG28" "-headerpad_max_install_names" "-image_base" "ARG29" "-init" "ARG30" "-macosx_version_min" "10.3.2" "-nomultidefs" "-multi_module" "-single_module" "-multiply_defined" "ARG37" "-multiply_defined_unused" "ARG38" "-pie" "-prebind" "-noprebind" "-nofixprebinding" "-prebind_all_twolevel_modules" "-read_only_relocs" "ARG55" "-sectcreate" "ARG58_0" "ARG58_1" "ARG58_2" "-sectorder" "ARG60_0" "ARG60_1" "ARG60_2" "-seg1addr" "ARG61" "-segprot" "ARG67_0" "ARG67_1" "ARG67_2" "-segaddr" "ARG64_0" "ARG64_1" "-segs_read_only_addr" "ARG69" "-segs_read_write_addr" "ARG70" "-seg_addr_table" "ARG62" "-seg_addr_table_filename" "ARG63" "-sub_library" "ARG77" "-sub_umbrella" "ARG78" "-twolevel_namespace" "-twolevel_namespace_hints" "-umbrella" "ARG83" "-undefined" "ARG84" "-unexported_symbols_list" "ARG85" "-weak_reference_mismatches" "ARG87" "-X" "-y" "-w" "-pagezero_size" "ARG54" "-segs_read_FOO" "-seglinkedit" "-noseglinkedit" "-sectalign" "ARG57_0" "ARG57_1" "ARG57_2" "-sectobjectsymbols" "ARG59_0" "ARG59_1" "-segcreate" "ARG65_0" "ARG65_1" "ARG65_2" "-whyload" "-whatsloaded" "-dylinker_install_name" "ARG16" "-dylinker" "-Mach" "-d" "-s" "-t" "-Z" "-u" "ARG82" "-undefined" "ARG84" "-A" "ARG0" "-e" "ARG19" "-m" "ARG33" "-r" "-o" "a.out" "-LARG2" "-lgomp".* "-filelist" "FOO" "-lFOO" "-allow_stack_execute" ".*/libprofile_rt.*" "-T" "ARG4" "-FARG1"}} - // Check linker changes that came with new linkedit format. // RUN: touch %t.o -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log // RUN: FileCheck -check-prefix=LINK_IPHONE_3_0 %s < %t.log // LINK_IPHONE_3_0: {{ld(.exe)?"}} @@ -41,9 +28,9 @@ // LINK_IPHONE_3_0: -lbundle1.o // LINK_IPHONE_3_0: -lSystem -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log // RUN: FileCheck -check-prefix=LINK_IPHONE_3_1 %s < %t.log // LINK_IPHONE_3_1: {{ld(.exe)?"}} @@ -58,26 +45,26 @@ // LINK_IPHONE_3_1-NOT: -lbundle1.o // LINK_IPHONE_3_1: -lSystem -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -fpie %t.o 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -fpie %t.o 2> %t.log // RUN: FileCheck -check-prefix=LINK_EXPLICIT_PIE %s < %t.log // // LINK_EXPLICIT_PIE: {{ld(.exe)?"}} // LINK_EXPLICIT_PIE: "-pie" -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -fno-pie %t.o 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -fno-pie %t.o 2> %t.log // RUN: FileCheck -check-prefix=LINK_EXPLICIT_NO_PIE %s < %t.log // // LINK_EXPLICIT_NO_PIE: {{ld(.exe)?"}} // LINK_EXPLICIT_NO_PIE: "-no_pie" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ +// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ // RUN: -mlinker-version=100 2> %t.log // RUN: FileCheck -check-prefix=LINK_NEWER_DEMANGLE %s < %t.log // // LINK_NEWER_DEMANGLE: {{ld(.exe)?"}} // LINK_NEWER_DEMANGLE: "-demangle" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ +// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ // RUN: -mlinker-version=100 -Wl,--no-demangle 2> %t.log // RUN: FileCheck -check-prefix=LINK_NEWER_NODEMANGLE %s < %t.log // @@ -85,7 +72,7 @@ // LINK_NEWER_NODEMANGLE-NOT: "-demangle" // LINK_NEWER_NODEMANGLE: "-lSystem" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ +// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ // RUN: -mlinker-version=95 2> %t.log // RUN: FileCheck -check-prefix=LINK_OLDER_NODEMANGLE %s < %t.log // @@ -93,7 +80,7 @@ // LINK_OLDER_NODEMANGLE-NOT: "-demangle" // LINK_OLDER_NODEMANGLE: "-lSystem" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ +// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ // RUN: -mlinker-version=117 -flto 2> %t.log // RUN: cat %t.log // RUN: FileCheck -check-prefix=LINK_OBJECT_LTO_PATH %s < %t.log @@ -101,10 +88,36 @@ // LINK_OBJECT_LTO_PATH: {{ld(.exe)?"}} // LINK_OBJECT_LTO_PATH: "-object_path_lto" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ +// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ // RUN: -force_load a -force_load b 2> %t.log // RUN: cat %t.log // RUN: FileCheck -check-prefix=FORCE_LOAD %s < %t.log // // FORCE_LOAD: {{ld(.exe)?"}} // FORCE_LOAD: "-force_load" "a" "-force_load" "b" + +// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ +// RUN: -lazy_framework Framework 2> %t.log +// +// RUN: FileCheck -check-prefix=LINK_LAZY_FRAMEWORK %s < %t.log +// LINK_LAZY_FRAMEWORK: {{ld(.exe)?"}} +// LINK_LAZY_FRAMEWORK: "-lazy_framework" "Framework" + +// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ +// RUN: -lazy_library Library 2> %t.log +// +// RUN: FileCheck -check-prefix=LINK_LAZY_LIBRARY %s < %t.log +// LINK_LAZY_LIBRARY: {{ld(.exe)?"}} +// LINK_LAZY_LIBRARY: "-lazy_library" "Library" + +// RUN: %clang -target x86_64-apple-darwin10 -### %t.o 2> %t.log +// RUN: %clang -target x86_64-apple-macosx10.7 -### %t.o 2>> %t.log +// RUN: FileCheck -check-prefix=LINK_VERSION_MIN %s < %t.log +// LINK_VERSION_MIN: {{ld(.exe)?"}} +// LINK_VERSION_MIN: "-macosx_version_min" "10.6.0" +// LINK_VERSION_MIN: {{ld(.exe)?"}} +// LINK_VERSION_MIN: "-macosx_version_min" "10.7.0" + +// RUN: %clang -target x86_64-apple-darwin12 -### %t.o 2> %t.log +// RUN: FileCheck -check-prefix=LINK_NO_CRT1 %s < %t.log +// LINK_NO_CRT1-NOT: crt diff --git a/test/Driver/darwin-objc-defaults.m b/test/Driver/darwin-objc-defaults.m index dc062aea36e9..49fe8f9b9f7c 100644 --- a/test/Driver/darwin-objc-defaults.m +++ b/test/Driver/darwin-objc-defaults.m @@ -2,7 +2,7 @@ // i386 -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch i386 -mmacosx-version-min=10.5 2> %t // RUN: FileCheck --check-prefix CHECK-I386_OSX10_5 < %t %s @@ -11,7 +11,7 @@ // CHECK-CHECK-I386_OSX10_5-NOT: -fobjc-dispatch-method // CHECK-CHECK-I386_OSX10_5: darwin-objc-defaults -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch i386 -mmacosx-version-min=10.6 2> %t // RUN: FileCheck --check-prefix CHECK-I386_OSX10_6 < %t %s @@ -20,7 +20,7 @@ // CHECK-CHECK-I386_OSX10_6-NOT: -fobjc-dispatch-method // CHECK-CHECK-I386_OSX10_6: darwin-objc-defaults -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch i386 -miphoneos-version-min=3.0 2> %t // RUN: FileCheck --check-prefix CHECK-I386_IPHONE3_0 < %t %s @@ -31,7 +31,7 @@ // x86_64 -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch x86_64 -mmacosx-version-min=10.5 2> %t // RUN: FileCheck --check-prefix CHECK-X86_64_OSX10_5 < %t %s @@ -40,7 +40,7 @@ // CHECK-CHECK-X86_64_OSX10_5: -fobjc-dispatch-method=non-legacy // CHECK-CHECK-X86_64_OSX10_5: darwin-objc-defaults -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch x86_64 -mmacosx-version-min=10.6 2> %t // RUN: FileCheck --check-prefix CHECK-X86_64_OSX10_6 < %t %s @@ -49,7 +49,7 @@ // CHECK-CHECK-X86_64_OSX10_6: -fobjc-dispatch-method=mixed // CHECK-CHECK-X86_64_OSX10_6: darwin-objc-defaults -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch x86_64 -miphoneos-version-min=3.0 2> %t // RUN: FileCheck --check-prefix CHECK-X86_64_IPHONE3_0 < %t %s @@ -60,7 +60,7 @@ // armv7 -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch armv7 -mmacosx-version-min=10.5 2> %t // RUN: FileCheck --check-prefix CHECK-ARMV7_OSX10_5 < %t %s @@ -69,7 +69,7 @@ // CHECK-CHECK-ARMV7_OSX10_5-NOT: -fobjc-dispatch-method // CHECK-CHECK-ARMV7_OSX10_5: darwin-objc-defaults -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch armv7 -mmacosx-version-min=10.6 2> %t // RUN: FileCheck --check-prefix CHECK-ARMV7_OSX10_6 < %t %s @@ -78,7 +78,7 @@ // CHECK-CHECK-ARMV7_OSX10_6-NOT: -fobjc-dispatch-method // CHECK-CHECK-ARMV7_OSX10_6: darwin-objc-defaults -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch armv7 -miphoneos-version-min=3.0 2> %t // RUN: FileCheck --check-prefix CHECK-ARMV7_IPHONE3_0 < %t %s diff --git a/test/Driver/darwin-objc-gc.m b/test/Driver/darwin-objc-gc.m index aecb9a6b146f..06e3aea9847b 100644 --- a/test/Driver/darwin-objc-gc.m +++ b/test/Driver/darwin-objc-gc.m @@ -1,6 +1,6 @@ // Check that we warn, but accept, -fobjc-gc for iPhone OS. -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -miphoneos-version-min=3.0 -fobjc-gc -flto -S -o %t %s 2> %t.err +// RUN: %clang -target i386-apple-darwin9 -miphoneos-version-min=3.0 -fobjc-gc -flto -S -o %t %s 2> %t.err // RUN: FileCheck --check-prefix=IPHONE_OBJC_GC_LL %s < %t // RUN: FileCheck --check-prefix=IPHONE_OBJC_GC_STDERR %s < %t.err diff --git a/test/Driver/darwin-objc-options.m b/test/Driver/darwin-objc-options.m index a62a62c4fa70..5b421d891ff4 100644 --- a/test/Driver/darwin-objc-options.m +++ b/test/Driver/darwin-objc-options.m @@ -1,6 +1,6 @@ // Check miscellaneous Objective-C options. -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch x86_64 -fobjc-abi-version=1 2> %t // RUN: FileCheck --check-prefix CHECK-X86_64_ABI1 < %t %s @@ -9,7 +9,7 @@ // CHECK-CHECK-X86_64_ABI1-NOT: -fobjc-dispatch-method // CHECK-CHECK-X86_64_ABI1: darwin-objc-options -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \ +// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \ // RUN: -arch i386 -fobjc-abi-version=2 2> %t // RUN: FileCheck --check-prefix CHECK-I386_ABI2 < %t %s diff --git a/test/Driver/darwin-verify-debug.c b/test/Driver/darwin-verify-debug.c index 1e4eff8c83f1..677419a20c5b 100644 --- a/test/Driver/darwin-verify-debug.c +++ b/test/Driver/darwin-verify-debug.c @@ -1,7 +1,7 @@ // Check that we verify debug output properly with multiple -arch options. // // REQUIRES: asserts -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-phases \ +// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \ // RUN: -verify -arch i386 -arch x86_64 %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s // @@ -9,7 +9,7 @@ // CHECK-MULTIARCH-ACTIONS: 8: dsymutil, {7}, dSYM // CHECK-MULTIARCH-ACTIONS: 9: verify, {8}, none // -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ // RUN: -verify -arch i386 -arch x86_64 %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s // @@ -18,7 +18,7 @@ // Check output name derivation. // -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ // RUN: -verify -o foo %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-OUTPUT-NAME < %t %s // @@ -29,6 +29,6 @@ // Check that we only verify when needed. // // RUN: touch %t.o -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ // RUN: -verify -o foo %t.o -g 2> %t // RUN: grep "Verify" %t | count 0 diff --git a/test/Driver/darwin-version.c b/test/Driver/darwin-version.c index d9c5c5ed3f7b..2478a99dad5f 100644 --- a/test/Driver/darwin-version.c +++ b/test/Driver/darwin-version.c @@ -1,5 +1,5 @@ // RUN: env MACOSX_DEPLOYMENT_TARGET=10.1 \ -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -DTEST0 -E %s +// RUN: %clang -target i386-apple-darwin9 -DTEST0 -E %s #ifdef TEST0 #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1010 #error Invalid version @@ -7,7 +7,7 @@ #endif // RUN: env IPHONEOS_DEPLOYMENT_TARGET=2.0 \ -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -DTEST1 -E %s +// RUN: %clang -target i386-apple-darwin9 -DTEST1 -E %s #ifdef TEST1 #if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ != 20000 #error Invalid version @@ -15,7 +15,7 @@ #endif // RUN: env IPHONEOS_DEPLOYMENT_TARGET=2.3.1 \ -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -DTEST2 -E %s +// RUN: %clang -target i386-apple-darwin9 -DTEST2 -E %s #ifdef TEST2 #if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ != 20301 #error Invalid version @@ -23,7 +23,7 @@ #endif // RUN: env MACOSX_DEPLOYMENT_TARGET=10.4.10 \ -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -DTEST3 -E %s +// RUN: %clang -target i386-apple-darwin9 -DTEST3 -E %s #ifdef TEST3 #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1049 #error Invalid version diff --git a/test/Driver/darwin-xarch.c b/test/Driver/darwin-xarch.c index 4c6689cef0fc..3014236f8ccd 100644 --- a/test/Driver/darwin-xarch.c +++ b/test/Driver/darwin-xarch.c @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \ +// RUN: %clang -target x86_64-apple-darwin10 -### \ // RUN: -arch i386 -Xarch_i386 -mmacosx-version-min=10.4 \ // RUN: -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 \ // RUN: -c %s 2> %t @@ -7,13 +7,13 @@ // CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "i386-apple-macosx10.4.0" // CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "x86_64-apple-macosx10.5.0" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \ +// RUN: %clang -target x86_64-apple-darwin10 -### \ // RUN: -arch i386 -Xarch_i386 -Wl,-some-linker-arg -filelist X 2> %t // RUN: FileCheck --check-prefix=CHECK-LINK < %t %s // // CHECK-LINK: ld{{.*}} "-arch" "i386"{{.*}} "-some-linker-arg" -// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \ +// RUN: %clang -target x86_64-apple-darwin10 -### \ // RUN: -arch armv7 -Xarch_armv7 -Wl,-some-linker-arg -filelist X 2> %t // RUN: FileCheck --check-prefix=CHECK-ARMV7-LINK < %t %s // diff --git a/test/Driver/debug-options-as.c b/test/Driver/debug-options-as.c new file mode 100644 index 000000000000..a1dbe2e048df --- /dev/null +++ b/test/Driver/debug-options-as.c @@ -0,0 +1,18 @@ +// cygming have not supported integrated-as yet. +// XFAIL: cygwin,mingw32 +// +// Check to make sure clang is somewhat picky about -g options. +// (Delived from debug-options.c) +// rdar://10383444 +// RUN: %clang -### -c -save-temps -g %s 2>&1 | FileCheck -check-prefix=SAVE %s +// +// SAVE: "-cc1as" +// SAVE-NOT: "-g" + +// Check to make sure clang with -g on a .s file gets passed. +// rdar://9275556 +// RUN: touch %t.s +// RUN: %clang -### -c -g %t.s 2>&1 | FileCheck -check-prefix=S %s +// +// S: "-cc1as" +// S: "-g" diff --git a/test/Driver/debug-options.c b/test/Driver/debug-options.c new file mode 100644 index 000000000000..5dad8e938249 --- /dev/null +++ b/test/Driver/debug-options.c @@ -0,0 +1,27 @@ +// Check to make sure clang is somewhat picky about -g options. +// rdar://10383444 + +// RUN: %clang -### -c -g %s 2>&1 | FileCheck -check-prefix=G %s +// RUN: %clang -### -c -g2 %s 2>&1 | FileCheck -check-prefix=G2 %s +// RUN: %clang -### -c -g3 %s 2>&1 | FileCheck -check-prefix=G3 %s +// RUN: %clang -### -c -ganything %s 2>&1 | FileCheck -check-prefix=GANY %s +// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=GGDB %s +// RUN: %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=GFOO %s +// +// G: "-cc1" +// G: "-g" +// +// G2: "-cc1" +// G2: "-g" +// +// G3: "-cc1" +// G3: "-g" +// +// GANY: "-cc1" +// GANY-NOT: "-g" +// +// GGDB: "-cc1" +// GGDB: "-g" +// +// GFOO: "-cc1" +// GFOO-NOT: "-g" diff --git a/test/Driver/debug.c b/test/Driver/debug.c new file mode 100644 index 000000000000..ca1ca30ae6b5 --- /dev/null +++ b/test/Driver/debug.c @@ -0,0 +1,11 @@ +// RUN: cd %S && %clang -### -g %s -c 2>&1 | FileCheck -check-prefix=CHECK-PWD %s +// CHECK-PWD: {{"-fdebug-compilation-dir" ".*Driver.*"}} + +// RUN: env PWD=/foo %clang -### -g %s -c 2>&1 | FileCheck -check-prefix=CHECK-FOO %s +// CHECK-FOO: {{"-fdebug-compilation-dir" ".*foo"}} + +// "PWD=/foo gcc" wouldn't necessarily work. You would need to pick a different +// path to the same directory (try a symlink). + +// This depends on host's behavior how $PWD would be set. +// REQUIRES: shell diff --git a/test/Driver/default-toolchain.c b/test/Driver/default-toolchain.c index eeff7637b20e..b9111a620055 100644 --- a/test/Driver/default-toolchain.c +++ b/test/Driver/default-toolchain.c @@ -1,8 +1,8 @@ -// RUN: %clang -ccc-host-triple i386-unknown-unknown -m64 -v 2> %t +// RUN: %clang -target i386-unknown-unknown -m64 -v 2> %t // RUN: grep 'Target: x86_64-unknown-unknown' %t -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -arch ppc -m64 -v 2> %t +// RUN: %clang -target i386-apple-darwin9 -arch ppc -m64 -v 2> %t // RUN: grep 'Target: powerpc64-apple-darwin9' %t -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -arch ppc64 -m32 -v 2> %t +// RUN: %clang -target i386-apple-darwin9 -arch ppc64 -m32 -v 2> %t // RUN: grep 'Target: powerpc-apple-darwin9' %t diff --git a/test/Driver/diagnostics.c b/test/Driver/diagnostics.c new file mode 100644 index 000000000000..8500fad89d83 --- /dev/null +++ b/test/Driver/diagnostics.c @@ -0,0 +1,9 @@ +// Parse diagnostic arguments in the driver +// PR12181 + +// RUN: not %clang -target x86_64-apple-darwin10 \ +// RUN: -fsyntax-only -fzyzzybalubah \ +// RUN: -Werror=unused-command-line-argument %s + +// RUN: not %clang -target x86_64-apple-darwin10 \ +// RUN: -fsyntax-only -fzyzzybalubah -Werror %s diff --git a/test/Driver/dragonfly.c b/test/Driver/dragonfly.c index d768fe656b72..8a629da817a0 100644 --- a/test/Driver/dragonfly.c +++ b/test/Driver/dragonfly.c @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-host-triple amd64-pc-dragonfly %s -### 2> %t.log +// RUN: %clang -no-canonical-prefixes -target amd64-pc-dragonfly %s -### 2> %t.log // RUN: FileCheck -input-file %t.log %s // CHECK: clang{{.*}}" "-cc1" "-triple" "amd64-pc-dragonfly" diff --git a/test/Driver/dwarf2-cfi-asm.c b/test/Driver/dwarf2-cfi-asm.c new file mode 100644 index 000000000000..a5c4878703bd --- /dev/null +++ b/test/Driver/dwarf2-cfi-asm.c @@ -0,0 +1,35 @@ +// RUN: %clang -target x86_64-apple-darwin -### -S -integrated-as %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-MC-DEFAULT %s +// RUN: %clang -target x86_64-apple-darwin -### -S -integrated-as -fdwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-MC-CFI %s +// RUN: %clang -target x86_64-apple-darwin -### -S -integrated-as -fno-dwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-MC-NOCFI %s + +// RUN: %clang -target x86_64-apple-darwin -### -S -no-integrated-as %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-AS-DEFAULT %s +// RUN: %clang -target x86_64-apple-darwin -### -S -no-integrated-as -fdwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-AS-CFI %s +// RUN: %clang -target x86_64-apple-darwin -### -S -no-integrated-as -fno-dwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-DARWIN-AS-NOCFI %s + + +// RUN: %clang -target x86_64-pc-linux -### -S -integrated-as %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-MC-DEFAULT %s +// RUN: %clang -target x86_64-pc-linux -### -S -integrated-as -fdwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-MC-CFI %s +// RUN: %clang -target x86_64-pc-linux -### -S -integrated-as -fno-dwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-MC-NOCFI %s + +// RUN: %clang -target x86_64-pc-linux -### -S -no-integrated-as %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-AS-DEFAULT %s +// RUN: %clang -target x86_64-pc-linux -### -S -no-integrated-as -fdwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-AS-CFI %s +// RUN: %clang -target x86_64-pc-linux -### -S -no-integrated-as -fno-dwarf2-cfi-asm %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-LINUX-AS-NOCFI %s + + + +// CHECK-DARWIN-MC-DEFAULT-NOT: -fno-dwarf2-cfi-asm +// CHECK-DARWIN-MC-CFI-NOT: -fno-dwarf2-cfi-asm +// CHECK-DARWIN-MC-NOCFI: -fno-dwarf2-cfi-asm + +// CHECK-DARWIN-AS-DEFAULT: -fno-dwarf2-cfi-asm +// CHECK-DARWIN-AS-CFI-NOT: -fno-dwarf2-cfi-asm +// CHECK-DARWIN-AS-NOCFI: -fno-dwarf2-cfi-asm + + +// CHECK-LINUX-MC-DEFAULT-NOT: -fno-dwarf2-cfi-asmx +// CHECK-LINUX-MC-CFI-NOT: -fno-dwarf2-cfi-asm +// CHECK-LINUX-MC-NOCFI: -fno-dwarf2-cfi-asm + +// CHECK-LINUX-AS-DEFAULT-NOT: -fno-dwarf2-cfi-asm +// CHECK-LINUX-AS-CFI-NOT: -fno-dwarf2-cfi-asm +// CHECK-LINUX-AS-NOCFI: -fno-dwarf2-cfi-asm diff --git a/test/Driver/exceptions.m b/test/Driver/exceptions.m index 7d85fe30aefa..9b747bb84d19 100644 --- a/test/Driver/exceptions.m +++ b/test/Driver/exceptions.m @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-host-triple x86_64-apple-darwin9 \ +// RUN: %clang -target x86_64-apple-darwin9 \ // RUN: -fsyntax-only -fno-exceptions %s void f1() { diff --git a/test/Driver/fast-math.c b/test/Driver/fast-math.c new file mode 100644 index 000000000000..aef7cc3624d0 --- /dev/null +++ b/test/Driver/fast-math.c @@ -0,0 +1,119 @@ +// Test that the GCC fast-math floating point flags get lowered to the correct +// permutation of Clang frontend flags. This is non-trivial for a few reasons. +// First, the GCC flags have many different and surprising effects. Second, +// LLVM only supports three switches which is more coarse grained than GCC's +// support. +// +// RUN: %clang -### -fno-honor-infinities -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-INFS %s +// CHECK-NO-INFS: "-cc1" +// CHECK-NO-INFS: "-menable-no-infs" +// +// RUN: %clang -### -fno-honor-nans -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NANS %s +// CHECK-NO-NANS: "-cc1" +// CHECK-NO-NANS: "-menable-no-nans" +// +// RUN: %clang -### -fmath-errno -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s +// CHECK-MATH-ERRNO: "-cc1" +// CHECK-MATH-ERRNO: "-fmath-errno" +// +// RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \ +// RUN: -fno-trapping-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s +// CHECK-UNSAFE-MATH: "-cc1" +// CHECK-UNSAFE-MATH: "-menable-unsafe-fp-math" +// +// Check that various umbrella flags also enable these frontend options. +// RUN: %clang -### -ffast-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-INFS %s +// RUN: %clang -### -ffast-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NANS %s +// RUN: %clang -### -ffast-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s +// RUN: %clang -### -ffinite-math-only -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-INFS %s +// RUN: %clang -### -ffinite-math-only -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NANS %s +// RUN: %clang -### -funsafe-math-optimizations -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s +// +// One umbrella flag is *really* weird and also changes the semantics of the +// program by adding a special preprocessor macro. Check that the frontend flag +// modeling this semantic change is provided. Also check that the semantic +// impact remains even if every optimization is disabled. +// RUN: %clang -### -ffast-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FAST-MATH %s +// RUN: %clang -### -ffast-math -fno-finite-math-only \ +// RUN: -fno-unsafe-math-optimizations -fmath-errno -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FAST-MATH %s +// CHECK-FAST-MATH: "-cc1" +// CHECK-FAST-MATH: "-ffast-math" +// +// Check various means of disabling these flags, including disabling them after +// they've been enabled via an umbrella flag. +// RUN: %clang -### -fno-honor-infinities -fhonor-infinities -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NO-INFS %s +// RUN: %clang -### -ffinite-math-only -fhonor-infinities -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NO-INFS %s +// RUN: %clang -### -ffinite-math-only -fno-finite-math-only -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NO-INFS %s +// RUN: %clang -### -ffast-math -fhonor-infinities -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NO-INFS %s +// RUN: %clang -### -ffast-math -fno-finite-math-only -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NO-INFS %s +// CHECK-NO-NO-INFS: "-cc1" +// CHECK-NO-NO-INFS-NOT: "-menable-no-infs" +// CHECK-NO-NO-INFS: "-o" +// +// RUN: %clang -### -fno-honor-nans -fhonor-nans -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s +// RUN: %clang -### -ffinite-math-only -fhonor-nans -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s +// RUN: %clang -### -ffinite-math-only -fno-finite-math-only -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s +// RUN: %clang -### -ffast-math -fhonor-nans -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s +// RUN: %clang -### -ffast-math -fno-finite-math-only -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s +// CHECK-NO-NO-NANS: "-cc1" +// CHECK-NO-NO-NANS-NOT: "-menable-no-nans" +// CHECK-NO-NO-NANS: "-o" +// +// RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \ +// RUN: -fno-trapping-math -fno-associative-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \ +// RUN: -fno-trapping-math -fno-reciprocal-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \ +// RUN: -fno-trapping-math -fsigned-zeros -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \ +// RUN: -fno-trapping-math -ftrapping-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -funsafe-math-optimizations -fno-associative-math -c %s \ +// RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -funsafe-math-optimizations -fno-reciprocal-math -c %s \ +// RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -funsafe-math-optimizations -fsigned-zeros -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -funsafe-math-optimizations -ftrapping-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -funsafe-math-optimizations -fno-unsafe-math-optimizations \ +// RUN: -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -ffast-math -fno-associative-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -ffast-math -fno-reciprocal-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -ffast-math -fsigned-zeros -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -ffast-math -ftrapping-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// RUN: %clang -### -ffast-math -fno-unsafe-math-optimizations -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s +// CHECK-NO-UNSAFE-MATH: "-cc1" +// CHECK-NO-UNSAFE-MATH-NOT: "-menable-unsafe-fp-math" +// CHECK-NO-UNSAFE-MATH: "-o" diff --git a/test/Driver/flags.c b/test/Driver/flags.c index 6d80892da65a..7a885b699b15 100644 --- a/test/Driver/flags.c +++ b/test/Driver/flags.c @@ -1,9 +1,9 @@ -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -S -msoft-float %s 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -S -msoft-float %s 2> %t.log // RUN: grep '"-no-implicit-float"' %t.log -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -S -msoft-float -mno-soft-float %s 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -S -msoft-float -mno-soft-float %s 2> %t.log // RUN: grep '"-no-implicit-float"' %t.log | count 0 -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -S -mno-soft-float %s -msoft-float 2> %t.log +// RUN: %clang -target i386-apple-darwin9 -### -S -mno-soft-float %s -msoft-float 2> %t.log // RUN: grep '"-no-implicit-float"' %t.log diff --git a/test/Driver/frame-pointer.c b/test/Driver/frame-pointer.c new file mode 100644 index 000000000000..6be395c59880 --- /dev/null +++ b/test/Driver/frame-pointer.c @@ -0,0 +1,24 @@ +// RUN: %clang -target i386-pc-linux -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s +// RUN: %clang -target i386-pc-linux -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s +// RUN: %clang -target i386-pc-linux -### -S -O2 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK2-32 %s +// RUN: %clang -target i386-pc-linux -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK3-32 %s +// RUN: %clang -target i386-pc-linux -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-32 %s + + +// RUN: %clang -target x86_64-pc-linux -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-64 %s +// RUN: %clang -target x86_64-pc-linux -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-64 %s +// RUN: %clang -target x86_64-pc-linux -### -S -O2 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK2-64 %s +// RUN: %clang -target x86_64-pc-linux -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK3-64 %s +// RUN: %clang -target x86_64-pc-linux -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-64 %s + +// CHECK0-32: -mdisable-fp-elim +// CHECK1-32-NOT: -mdisable-fp-elim +// CHECK2-32-NOT: -mdisable-fp-elim +// CHECK3-32-NOT: -mdisable-fp-elim +// CHECKs-32-NOT: -mdisable-fp-elim + +// CHECK0-64: -mdisable-fp-elim +// CHECK1-64-NOT: -mdisable-fp-elim +// CHECK2-64-NOT: -mdisable-fp-elim +// CHECK3-64-NOT: -mdisable-fp-elim +// CHECKs-64-NOT: -mdisable-fp-elim diff --git a/test/Driver/freebsd.c b/test/Driver/freebsd.c index 87ac6d754ee6..1fb84a02ac68 100644 --- a/test/Driver/freebsd.c +++ b/test/Driver/freebsd.c @@ -1,19 +1,30 @@ -// RUN: %clang -ccc-clang-archs "" -ccc-host-triple powerpc64-pc-freebsd8 %s -### 2> %t -// RUN: FileCheck --check-prefix=CHECK-PPC < %t %s +// REQUIRES: ppc32-registered-target,ppc64-registered-target +// RUN: %clang -ccc-clang-archs powerpc -no-canonical-prefixes \ +// RUN: -target powerpc-pc-freebsd8 %s \ +// RUN: --sysroot=%S/Inputs/basic_freebsd_tree -### 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-PPC %s +// CHECK-PPC: clang{{.*}}" "-cc1" "-triple" "powerpc-pc-freebsd8" +// CHECK-PPC: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-PPC: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o" +// +// RUN: %clang -ccc-clang-archs powerpc64 -no-canonical-prefixes \ +// RUN: -target powerpc64-pc-freebsd8 %s \ +// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-PPC64 %s +// CHECK-PPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64-pc-freebsd8" +// CHECK-PPC64: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-PPC64: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o" // -// CHECK-PPC: clang{{.*}}" "-cc1" "-triple" "powerpc64-pc-freebsd8" -// CHECK-PPC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o" - - -// Check that -m32 properly adjusts the toolchain flags. // -// RUN: %clang -ccc-host-triple x86_64-pc-freebsd8 -m32 -### %s 2> %t -// RUN: FileCheck --check-prefix=CHECK-LIB32 < %t %s +// Check that -m32 properly adjusts the toolchain flags. // +// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \ +// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-LIB32 %s // CHECK-LIB32: clang{{.*}}" "-cc1" "-triple" "i386-pc-freebsd8" // CHECK-LIB32: ld{{.*}}" {{.*}} "-m" "elf_i386_fbsd" // -// RUN: %clang -ccc-host-triple x86_64-pc-freebsd8 -m32 -print-search-dirs %s > %t -// RUN: FileCheck --check-prefix=CHECK-LIB32PATHS < %t %s -// +// RUN: %clang -target x86_64-pc-freebsd8 -m32 %s 2>&1 \ +// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -print-search-dirs 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-LIB32PATHS %s // CHECK-LIB32PATHS: libraries: ={{.*:?}}/usr/lib32 diff --git a/test/Driver/gcc-toolchain.cpp b/test/Driver/gcc-toolchain.cpp new file mode 100644 index 000000000000..e122dac9b97d --- /dev/null +++ b/test/Driver/gcc-toolchain.cpp @@ -0,0 +1,23 @@ +// Test that gcc-toolchain option is working correctly +// +// RUN: %clangxx -no-canonical-prefixes %s -### -o %t 2>&1 \ +// RUN: -target i386-unknown-linux \ +// RUN: -gcc-toolchain %S/Inputs/ubuntu_11.04_multiarch_tree/usr \ +// RUN: | FileCheck %s +// +// Test for header search toolchain detection. +// CHECK: "-internal-isystem" +// CHECK: "[[TOOLCHAIN:[^"]+]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5" +// CHECK: "-internal-isystem" +// CHECK: "[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/i686-linux-gnu" +// CHECK: "-internal-isystem" +// CHECK: "[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/backward" +// CHECK: "-internal-isystem" "/usr/local/include" +// +// Test for linker toolchain detection. Note that only the '-L' flags will use +// the same precise formatting of the path as the '-internal-system' flags +// above, so we just blanket wildcard match the 'crtbegin.o'. +// CHECK: "{{[^"]*}}ld{{(.exe)?}}" +// CHECK: "{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/crtbegin.o" +// CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" +// CHECK: "-L[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." diff --git a/test/Driver/gcc_forward.c b/test/Driver/gcc_forward.c index c584a4e8faf5..77f401b92e5a 100644 --- a/test/Driver/gcc_forward.c +++ b/test/Driver/gcc_forward.c @@ -1,6 +1,6 @@ // Check that we don't try to forward -Xclang or -mlinker-version to GCC. // -// RUN: %clang -ccc-host-triple powerpc-unknown-unknown \ +// RUN: %clang -target powerpc-unknown-unknown \ // RUN: -ccc-clang-archs i386 -c %s \ // RUN: -Xclang foo-bar \ // RUN: -mlinker-version=10 -### 2> %t diff --git a/test/Driver/gnu-runtime.m b/test/Driver/gnu-runtime.m index 5a3654c8c412..12426d950571 100644 --- a/test/Driver/gnu-runtime.m +++ b/test/Driver/gnu-runtime.m @@ -1,5 +1,5 @@ -// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s -// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -x objective-c++ -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s +// RUN: %clang -target i386-apple-darwin10 -### -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s +// RUN: %clang -target i386-apple-darwin10 -### -x objective-c++ -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s // CHECK: -fgnu-runtime // CHECK: -fobjc-runtime-has-arc // CHECK: -fobjc-runtime-has-weak diff --git a/test/Driver/gold-lto.c b/test/Driver/gold-lto.c new file mode 100644 index 000000000000..05ac27aab9fb --- /dev/null +++ b/test/Driver/gold-lto.c @@ -0,0 +1,6 @@ +// RUN: touch %t.o +// RUN: %clang -target x86_64-pc-linux-gnu -### %t.o -O4 -Wl,-plugin-opt=foo 2> %t.log +// RUN: FileCheck %s < %t.log + +// CHECK: "-plugin" "{{.*}}/LLVMgold.so" +// CHECK: "-plugin-opt=foo" diff --git a/test/Driver/invalid-o-level.c b/test/Driver/invalid-o-level.c new file mode 100644 index 000000000000..d5242c7ac066 --- /dev/null +++ b/test/Driver/invalid-o-level.c @@ -0,0 +1,4 @@ +// RUN: not %clang_cc1 %s -O900 2> %t.log +// RUN: FileCheck %s -input-file=%t.log + +// CHECK: invalid value '900' in '-O900' diff --git a/test/Driver/ios-simulator-arcruntime.c b/test/Driver/ios-simulator-arcruntime.c index bec9f7b1fdc8..9bf2091fed5d 100644 --- a/test/Driver/ios-simulator-arcruntime.c +++ b/test/Driver/ios-simulator-arcruntime.c @@ -1,5 +1,5 @@ -// RUN: %clang -### -x objective-c -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=40201 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s -// RUN: %clang -### -x objective-c -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s +// RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=40201 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s +// RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s // // CHECK-OPTIONS1-NOT: -fobjc-runtime-has-weak diff --git a/test/Driver/le32-unknown-nacl.cpp b/test/Driver/le32-unknown-nacl.cpp index bc31802410db..f68b2206f209 100644 --- a/test/Driver/le32-unknown-nacl.cpp +++ b/test/Driver/le32-unknown-nacl.cpp @@ -1,6 +1,6 @@ -// RUN: %clang -ccc-host-triple le32-unknown-nacl -ccc-clang-archs le32 -ccc-echo %s -emit-llvm-only -c 2>&1 | FileCheck %s -check-prefix=ECHO -// RUN: %clang -ccc-host-triple le32-unknown-nacl -ccc-clang-archs le32 %s -emit-llvm -S -c -o - | FileCheck %s -// RUN: %clang -ccc-host-triple le32-unknown-nacl -ccc-clang-archs le32 %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS +// RUN: %clang -target le32-unknown-nacl -ccc-clang-archs le32 -ccc-echo %s -emit-llvm-only -c 2>&1 | FileCheck %s -check-prefix=ECHO +// RUN: %clang -target le32-unknown-nacl -ccc-clang-archs le32 %s -emit-llvm -S -c -o - | FileCheck %s +// RUN: %clang -target le32-unknown-nacl -ccc-clang-archs le32 %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS // ECHO: {{.*}} -cc1 {{.*}}le32-unknown-nacl.c @@ -40,6 +40,11 @@ int align_ld = __alignof(long double); // CHECK: @align_vl = global i32 4 int align_vl = __alignof(va_list); +// CHECK: __LITTLE_ENDIAN__defined +#ifdef __LITTLE_ENDIAN__ +void __LITTLE_ENDIAN__defined() {} +#endif + // CHECK: __native_client__defined #ifdef __native_client__ void __native_client__defined() {} diff --git a/test/Driver/linker-opts.c b/test/Driver/linker-opts.c new file mode 100644 index 000000000000..d036dfd04fb5 --- /dev/null +++ b/test/Driver/linker-opts.c @@ -0,0 +1,5 @@ +// RUN: env LIBRARY_PATH=%T/test1 %clang -x c %s -### 2>&1 | FileCheck %s +// CHECK: "-L" "{{.*}}/test1" + +// GCC driver is used as linker on cygming. It should be aware of LIBRARY_PATH. +// XFAIL: cygwin,mingw32 diff --git a/test/Driver/linux-as.c b/test/Driver/linux-as.c new file mode 100644 index 000000000000..22eac0d2dd94 --- /dev/null +++ b/test/Driver/linux-as.c @@ -0,0 +1,31 @@ +// Check passing options to the assembler for ARM targets. +// +// RUN: %clang -target arm-linux -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ARM %s +// CHECK-ARM: as{{(.exe)?}}" +// +// RUN: %clang -target arm-linux -mcpu=cortex-a8 -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ARM-MCPU %s +// CHECK-ARM-MCPU: as{{(.exe)?}}" "-mcpu=cortex-a8" +// +// RUN: %clang -target arm-linux -mfpu=neon -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ARM-MFPU %s +// CHECK-ARM-MFPU: as{{(.exe)?}}" "-mfpu=neon" +// +// RUN: %clang -target arm-linux -march=armv7-a -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ARM-MARCH %s +// CHECK-ARM-MARCH: as{{(.exe)?}}" "-march=armv7-a" +// +// RUN: %clang -target arm-linux -mcpu=cortex-a8 -mfpu=neon -march=armv7-a -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ARM-ALL %s +// CHECK-ARM-ALL: as{{(.exe)?}}" "-march=armv7-a" "-mcpu=cortex-a8" "-mfpu=neon" +// +// RUN: %clang -target armv7-linux -mcpu=cortex-a8 -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ARM-TARGET %s +// CHECK-ARM-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mcpu=cortex-a8" diff --git a/test/Driver/linux-header-search.cpp b/test/Driver/linux-header-search.cpp new file mode 100644 index 000000000000..ea82660811d2 --- /dev/null +++ b/test/Driver/linux-header-search.cpp @@ -0,0 +1,75 @@ +// General tests that the header search paths detected by the driver and passed +// to CC1 are sane. +// +// Test a very broken version of multiarch that shipped in Ubuntu 11.04. +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target i386-unknown-linux \ +// RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \ +// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s +// CHECK-UBUNTU-11-04: "{{.*}}clang{{.*}}" "-cc1" +// CHECK-UBUNTU-11-04: "-isysroot" "[[SYSROOT:[^"]+]]" +// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5" +// 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" +// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/backward" +// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/local/include" +// CHECK-UBUNTU-11-04: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include" +// CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/include" +// CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" +// +// Thoroughly exercise the Debian multiarch environment. +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target i686-linux-gnu \ +// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s +// CHECK-DEBIAN-X86: "{{[^"]*}}clang{{[^"]*}}" "-cc1" +// CHECK-DEBIAN-X86: "-isysroot" "[[SYSROOT:[^"]+]]" +// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5" +// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/i686-linux-gnu" +// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/backward" +// CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/local/include" +// CHECK-DEBIAN-X86: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include" +// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/i386-linux-gnu" +// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/include" +// CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target x86_64-linux-gnu \ +// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s +// CHECK-DEBIAN-X86-64: "{{[^"]*}}clang{{[^"]*}}" "-cc1" +// CHECK-DEBIAN-X86-64: "-isysroot" "[[SYSROOT:[^"]+]]" +// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5" +// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/x86_64-linux-gnu" +// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/backward" +// CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/local/include" +// CHECK-DEBIAN-X86-64: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include" +// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu" +// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/include" +// CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" +// RUN: %clang -ccc-clang-archs powerpc -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target powerpc-linux-gnu \ +// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s +// CHECK-DEBIAN-PPC: "{{[^"]*}}clang{{[^"]*}}" "-cc1" +// CHECK-DEBIAN-PPC: "-isysroot" "[[SYSROOT:[^"]+]]" +// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5" +// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/powerpc-linux-gnu" +// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/backward" +// CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/local/include" +// CHECK-DEBIAN-PPC: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include" +// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc-linux-gnu" +// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/include" +// CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" +// RUN: %clang -ccc-clang-archs powerpc64 -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target powerpc64-linux-gnu \ +// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s +// CHECK-DEBIAN-PPC64: "{{[^"]*}}clang{{[^"]*}}" "-cc1" +// CHECK-DEBIAN-PPC64: "-isysroot" "[[SYSROOT:[^"]+]]" +// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5" +// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/powerpc64-linux-gnu" +// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/backward" +// CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/local/include" +// CHECK-DEBIAN-PPC64: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include" +// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc64-linux-gnu" +// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/include" +// CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c index 456f7add7fe1..9a35d5d386ec 100644 --- a/test/Driver/linux-ld.c +++ b/test/Driver/linux-ld.c @@ -2,7 +2,7 @@ // sysroot to make these tests independent of the host system. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple i386-unknown-linux \ +// RUN: -target i386-unknown-linux \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" @@ -14,7 +14,7 @@ // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple x86_64-unknown-linux \ +// RUN: -target x86_64-unknown-linux \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" @@ -26,7 +26,7 @@ // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple i386-unknown-linux -m32 \ +// RUN: -target i386-unknown-linux -m32 \ // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-32-TO-32 %s // CHECK-32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" @@ -42,7 +42,7 @@ // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple i386-unknown-linux -m64 \ +// RUN: -target i386-unknown-linux -m64 \ // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-32-TO-64 %s // CHECK-32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" @@ -59,7 +59,7 @@ // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple x86_64-unknown-linux -m64 \ +// RUN: -target x86_64-unknown-linux -m64 \ // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-64-TO-64 %s // CHECK-64-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" @@ -75,7 +75,7 @@ // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple x86_64-unknown-linux -m32 \ +// RUN: -target x86_64-unknown-linux -m32 \ // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-64-TO-32 %s // CHECK-64-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" @@ -92,7 +92,21 @@ // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple i386-unknown-linux -m32 \ +// RUN: -target x86_64-unknown-linux -m32 \ +// RUN: -gcc-toolchain %S/Inputs/multilib_64bit_linux_tree/usr \ +// RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-64-TO-32-SYSROOT %s +// CHECK-64-TO-32-SYSROOT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-64-TO-32-SYSROOT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32/crtbegin.o" +// CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32" +// CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib/../lib32" +// CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib/../lib32" +// CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0" +// CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib" +// CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -target i386-unknown-linux -m32 \ // RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-32 %s @@ -103,7 +117,7 @@ // Check that with 64-bit builds, we don't actually use the install directory // as its version of GCC is lower than our sysrooted version. // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple x86_64-unknown-linux -m64 \ +// RUN: -target x86_64-unknown-linux -m64 \ // RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-64 %s @@ -114,7 +128,7 @@ // Check that we support unusual patch version formats, including missing that // component. // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple i386-unknown-linux -m32 \ +// RUN: -target i386-unknown-linux -m32 \ // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing1/bin \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION1 %s @@ -122,7 +136,7 @@ // CHECK-GCC-VERSION1: "{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7/crtbegin.o" // CHECK-GCC-VERSION1: "-L{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7" // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple i386-unknown-linux -m32 \ +// RUN: -target i386-unknown-linux -m32 \ // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing2/bin \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION2 %s @@ -130,7 +144,7 @@ // CHECK-GCC-VERSION2: "{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x/crtbegin.o" // CHECK-GCC-VERSION2: "-L{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x" // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple i386-unknown-linux -m32 \ +// RUN: -target i386-unknown-linux -m32 \ // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing3/bin \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION3 %s @@ -138,10 +152,119 @@ // CHECK-GCC-VERSION3: "{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5/crtbegin.o" // CHECK-GCC-VERSION3: "-L{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5" // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ -// RUN: -ccc-host-triple i386-unknown-linux -m32 \ +// RUN: -target i386-unknown-linux -m32 \ // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing4/bin \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION4 %s // CHECK-GCC-VERSION4: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-GCC-VERSION4: "{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99/crtbegin.o" // CHECK-GCC-VERSION4: "-L{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99" +// +// Test a very broken version of multiarch that shipped in Ubuntu 11.04. +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -target i386-unknown-linux \ +// RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \ +// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s +// CHECK-UBUNTU-11-04: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-UBUNTU-11-04: "{{.*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/crtbegin.o" +// CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" +// CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../i386-linux-gnu" +// CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu" +// CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." +// CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/lib" +// CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib" +// +// Test the setup that shipped in SUSE 10.3 on ppc64. +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -target powerpc64-suse-linux \ +// RUN: --sysroot=%S/Inputs/suse_10.3_ppc64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-SUSE-10-3-PPC64 %s +// CHECK-SUSE-10-3-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-SUSE-10-3-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64/crtbegin.o" +// CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64" +// CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib64" +// CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/lib/../lib64" +// CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/../lib64" +// +// Check that we do not pass --hash-style=gnu and --hash-style=both to linker +// and provide correct path to the dynamic linker and emulation mode when build +// for MIPS platforms. +// RUN: %clang %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -ccc-clang-archs mips \ +// RUN: | FileCheck --check-prefix=CHECK-MIPS %s +// CHECK-MIPS: "{{.*}}ld{{(.exe)?}}" +// CHECK-MIPS: "-m" "elf32btsmip" +// CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1" +// CHECK-MIPS-NOT: "--hash-style={{gnu|both}}" +// RUN: %clang %s -### -o %t.o 2>&1 \ +// RUN: -target mipsel-linux-gnu -ccc-clang-archs mipsel \ +// RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s +// CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}" +// CHECK-MIPSEL: "-m" "elf32ltsmip" +// CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib/ld.so.1" +// CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}" +// RUN: %clang %s -### -o %t.o 2>&1 \ +// RUN: -target mips64-linux-gnu -ccc-clang-archs mips64 \ +// RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s +// CHECK-MIPS64: "{{.*}}ld{{(.exe)?}}" +// CHECK-MIPS64: "-m" "elf64btsmip" +// CHECK-MIPS64: "-dynamic-linker" "{{.*}}/lib64/ld.so.1" +// CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}" +// RUN: %clang %s -### -o %t.o 2>&1 \ +// RUN: -target mips64el-linux-gnu -ccc-clang-archs mips64el \ +// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s +// CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}" +// CHECK-MIPS64EL: "-m" "elf64ltsmip" +// CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/lib64/ld.so.1" +// CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}" +// +// Thoroughly exercise the Debian multiarch environment. +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -target i686-linux-gnu \ +// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s +// CHECK-DEBIAN-X86: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-DEBIAN-X86: "{{.*}}/usr/lib/gcc/i686-linux-gnu/4.5/crtbegin.o" +// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5" +// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../i386-linux-gnu" +// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu" +// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../.." +// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/lib" +// CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib" +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -target x86_64-linux-gnu \ +// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s +// CHECK-DEBIAN-X86-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-DEBIAN-X86-64: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.5/crtbegin.o" +// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5" +// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../x86_64-linux-gnu" +// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu" +// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../.." +// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/lib" +// CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib" +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -target powerpc-linux-gnu \ +// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s +// CHECK-DEBIAN-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-DEBIAN-PPC: "{{.*}}/usr/lib/gcc/powerpc-linux-gnu/4.5/crtbegin.o" +// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5" +// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../powerpc-linux-gnu" +// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/powerpc-linux-gnu" +// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../.." +// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/lib" +// CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib" +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -target powerpc64-linux-gnu \ +// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s +// CHECK-DEBIAN-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-DEBIAN-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-linux-gnu/4.5/crtbegin.o" +// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5" +// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../powerpc64-linux-gnu" +// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/powerpc64-linux-gnu" +// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../.." +// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/lib" +// CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib" +// diff --git a/test/Driver/mips-as.c b/test/Driver/mips-as.c new file mode 100644 index 000000000000..44b8d8d3c4d8 --- /dev/null +++ b/test/Driver/mips-as.c @@ -0,0 +1,31 @@ +// Check passing options to the assembler for MIPS targets. +// +// RUN: %clang -target mips-linux-gnu -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS32-EB-AS %s +// CHECK-MIPS32-EB-AS: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-EB" +// +// RUN: %clang -target mipsel-linux-gnu -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS32-EL-AS %s +// CHECK-MIPS32-EL-AS: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-EL" +// +// RUN: %clang -target mips64-linux-gnu -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS64-EB-AS %s +// CHECK-MIPS64-EB-AS: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-EB" +// +// RUN: %clang -target mips64el-linux-gnu -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS64-EL-AS %s +// CHECK-MIPS64-EL-AS: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-EL" +// +// RUN: %clang -target mips-linux-gnu -mabi=eabi -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS-EABI %s +// CHECK-MIPS-EABI: as{{(.exe)?}}" "-march" "mips32" "-mabi" "eabi" "-EB" +// +// RUN: %clang -target mips64-linux-gnu -mabi=n32 -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS-N32 %s +// CHECK-MIPS-N32: as{{(.exe)?}}" "-march" "mips64" "-mabi" "n32" "-EB" diff --git a/test/Driver/mips-float.c b/test/Driver/mips-float.c new file mode 100644 index 000000000000..c9e107f593ae --- /dev/null +++ b/test/Driver/mips-float.c @@ -0,0 +1,42 @@ +// Check handling -mhard-float / -msoft-float / -mfloat-abi options +// when build for MIPS platforms. +// +// Default +// RUN: %clang -ccc-clang-archs mips -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu \ +// RUN: | FileCheck --check-prefix=CHECK-DEF %s +// CHECK-DEF: "-mfloat-abi" "hard" +// +// -mhard-float +// RUN: %clang -ccc-clang-archs mips -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -mhard-float \ +// RUN: | FileCheck --check-prefix=CHECK-HARD %s +// CHECK-HARD: "-mfloat-abi" "hard" +// +// -msoft-float +// RUN: %clang -ccc-clang-archs mips -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -msoft-float \ +// RUN: | FileCheck --check-prefix=CHECK-SOFT %s +// CHECK-SOFT: "-msoft-float" +// CHECK-SOFT: "-mfloat-abi" "soft" +// CHECK-SOFT: "-target-feature" "+soft-float" +// +// -mfloat-abi=hard +// RUN: %clang -ccc-clang-archs mips -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -mfloat-abi=hard \ +// RUN: | FileCheck --check-prefix=CHECK-ABI-HARD %s +// CHECK-ABI-HARD: "-mfloat-abi" "hard" +// +// -mfloat-abi=soft +// RUN: %clang -ccc-clang-archs mips -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -mfloat-abi=soft \ +// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT %s +// CHECK-ABI-SOFT: "-msoft-float" +// CHECK-ABI-SOFT: "-mfloat-abi" "soft" +// CHECK-ABI-SOFT: "-target-feature" "+soft-float" +// +// -mfloat-abi=single +// RUN: %clang -ccc-clang-archs mips -c %s -### -o %t.o 2>&1 \ +// RUN: -target mips-linux-gnu -mfloat-abi=single \ +// RUN: | FileCheck --check-prefix=CHECK-ABI-SINGLE %s +// CHECK-ABI-SINGLE: "-target-feature" "+single-float" diff --git a/test/Driver/mno-global-merge.c b/test/Driver/mno-global-merge.c index b4d8f8757281..ec9f69e67ce2 100644 --- a/test/Driver/mno-global-merge.c +++ b/test/Driver/mno-global-merge.c @@ -1,10 +1,10 @@ -// RUN: %clang -ccc-host-triple armv7-apple-darwin10 \ +// RUN: %clang -target armv7-apple-darwin10 \ // RUN: -mno-global-merge -### -fsyntax-only %s 2> %t // RUN: FileCheck --check-prefix=CHECK-NGM < %t %s // CHECK-NGM: "-mno-global-merge" -// RUN: %clang -ccc-host-triple armv7-apple-darwin10 \ +// RUN: %clang -target armv7-apple-darwin10 \ // RUN: -mglobal-merge -### -fsyntax-only %s 2> %t // RUN: FileCheck --check-prefix=CHECK-GM < %t %s diff --git a/test/Driver/modules.m b/test/Driver/modules.m new file mode 100644 index 000000000000..b93054dbf87f --- /dev/null +++ b/test/Driver/modules.m @@ -0,0 +1,6 @@ +// RUN: %clang -fmodules -fno-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s +// CHECK-NO-MODULES-NOT: -fmodules + +// RUN: %clang -fmodules -fno-modules -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s +// CHECK-HAS-MODULES: -fmodules + diff --git a/test/Driver/modules.mm b/test/Driver/modules.mm new file mode 100644 index 000000000000..b2948c4b3d96 --- /dev/null +++ b/test/Driver/modules.mm @@ -0,0 +1,6 @@ +// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s +// RUN: %clang -fcxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s +// CHECK-NO-MODULES-NOT: -fmodules + +// RUN: %clang -fcxx-modules -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s +// CHECK-HAS-MODULES: -fmodules diff --git a/test/Driver/no-objc-arr.m b/test/Driver/no-objc-arr.m index 15fbdc20ce8a..e44939337a6a 100644 --- a/test/Driver/no-objc-arr.m +++ b/test/Driver/no-objc-arr.m @@ -1,4 +1,4 @@ -// RUN: %clang -Werror -fobjc-arc -fsyntax-only -fno-objc-arc -verify %s +// RUN: %clang -Werror -fobjc-arc -fsyntax-only -fno-objc-arc -Xclang -verify %s // rdar://8949617 void * FOO() { diff --git a/test/Driver/no-objc-default-synthesize-properties.m b/test/Driver/no-objc-default-synthesize-properties.m new file mode 100644 index 000000000000..e3805140fa04 --- /dev/null +++ b/test/Driver/no-objc-default-synthesize-properties.m @@ -0,0 +1,10 @@ +// RUN: %clang -fsyntax-only -fno-objc-default-synthesize-properties -fobjc-default-synthesize-properties %s 2>&1 | FileCheck %s + +@interface I +@property int P; +@end + +@implementation I +@end +// CHECK: warning: argument unused during compilation: '-fno-objc-default-synthesize-properties' +// CHECK: warning: argument unused during compilation: '-fobjc-default-synthesize-properties' diff --git a/test/Driver/no-sibling-calls.c b/test/Driver/no-sibling-calls.c new file mode 100644 index 000000000000..c24899013f18 --- /dev/null +++ b/test/Driver/no-sibling-calls.c @@ -0,0 +1,8 @@ +// RUN: %clang -### %s -fno-optimize-sibling-calls 2> %t +// RUN: FileCheck --check-prefix=CHECK-NOSC < %t %s +// CHECK-NOSC: "-mdisable-tail-calls" + +// RUN: %clang -### -foptimize-sibling-calls %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-OSC < %t %s +// CHECK-OSC-NOT: "-mdisable-tail-calls" + diff --git a/test/Driver/noinline.c b/test/Driver/noinline.c new file mode 100644 index 000000000000..e665b2f0aa24 --- /dev/null +++ b/test/Driver/noinline.c @@ -0,0 +1,10 @@ +// Make sure the driver is correctly passing -fno-inline-functions +// rdar://10972766 + +// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: -fno-inline -fno-inline-functions -### -fsyntax-only %s 2> %t +// RUN: FileCheck --check-prefix=CHECK < %t %s + +// CHECK: clang +// CHECK: "-fno-inline" +// CHECK: "-fno-inline-functions" diff --git a/test/Driver/nostdlib.c b/test/Driver/nostdlib.c index c73212f895e6..e9ada3172232 100644 --- a/test/Driver/nostdlib.c +++ b/test/Driver/nostdlib.c @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-host-triple i686-pc-linux-gnu -### -nostdlib %s 2> %t +// RUN: %clang -target i686-pc-linux-gnu -### -nostdlib %s 2> %t // RUN: FileCheck < %t %s // // CHECK-NOT: start-group diff --git a/test/Driver/nostdlibinc.c b/test/Driver/nostdlibinc.c index f7ee712d866c..5b6fab6a870b 100644 --- a/test/Driver/nostdlibinc.c +++ b/test/Driver/nostdlibinc.c @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-host-triple x86_64-unknown-unknown \ +// RUN: %clang -target x86_64-unknown-unknown \ // RUN: -nostdlibinc -ffreestanding -fsyntax-only %s #if !__has_include("stddef.h") diff --git a/test/Driver/openbsd.c b/test/Driver/openbsd.c index 34f6988c68e1..911c452c6c18 100644 --- a/test/Driver/openbsd.c +++ b/test/Driver/openbsd.c @@ -1,4 +1,4 @@ -// RUN: %clang -ccc-clang-archs "" -ccc-host-triple i686-pc-openbsd %s -### 2> %t.log +// RUN: %clang -no-canonical-prefixes -ccc-clang-archs "" -target i686-pc-openbsd %s -### 2> %t.log // RUN: FileCheck -input-file %t.log %s // CHECK: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" diff --git a/test/Driver/output-file-cleanup.c b/test/Driver/output-file-cleanup.c new file mode 100644 index 000000000000..0a0c96001b59 --- /dev/null +++ b/test/Driver/output-file-cleanup.c @@ -0,0 +1,25 @@ +// RUN: touch %t.o +// RUN: not %clang -DCRASH -o %t.o -MMD -MF %t.d %s +// RUN: test ! -f %t.o +// RUN: test ! -f %t.d + +// RUN: touch %t.o +// RUN: not %clang -DMISSING -o %t.o -MMD -MF %t.d %s +// RUN: test ! -f %t.o +// RUN: test ! -f %t.d + +// RUN: touch %t.o +// RUN: not %clang -o %t.o -MMD -MF %t.d %s +// RUN: test ! -f %t.o +// RUN: test -f %t.d + +// REQUIRES: shell +// REQUIRES: crash-recovery + +#ifdef CRASH +#pragma clang __debug crash +#elif defined(MISSING) +#include "nonexistent.h" +#else +invalid C code +#endif diff --git a/test/Driver/parsing.c b/test/Driver/parsing.c index ca3a7f44fd8e..eceba37d84fb 100644 --- a/test/Driver/parsing.c +++ b/test/Driver/parsing.c @@ -20,6 +20,3 @@ // RUN: %clang -ccc-print-options -Wally 2> %t // RUN: grep 'Option 0 - Name: "-ccc-print-options", Values: {}' %t // RUN: grep 'Option 1 - Name: "-W", Values: {"ally"}' %t - - - diff --git a/test/Driver/phases.c b/test/Driver/phases.c index 7fe529c51a93..4c480d59c14a 100644 --- a/test/Driver/phases.c +++ b/test/Driver/phases.c @@ -1,5 +1,5 @@ // Basic compilation for various types of files. -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c %s -x objective-c %s -x c++ %s -x objective-c++ -x assembler %s -x assembler-with-cpp %s -x none %s 2>&1 | FileCheck -check-prefix=BASIC %s +// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -x c %s -x objective-c %s -x c++ %s -x objective-c++ -x assembler %s -x assembler-with-cpp %s -x none %s 2>&1 | FileCheck -check-prefix=BASIC %s // BASIC: 0: input, "{{.*}}phases.c", c // BASIC: 1: preprocessor, {0}, cpp-output // BASIC: 2: compiler, {1}, assembler @@ -24,7 +24,7 @@ // BASIC: 21: linker, {3, 7, 11, 13, 16, 20}, image // Universal linked image. -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=ULI %s +// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=ULI %s // ULI: 0: input, "{{.*}}phases.c", c // ULI: 1: preprocessor, {0}, cpp-output // ULI: 2: compiler, {1}, assembler @@ -35,7 +35,7 @@ // ULI: 7: lipo, {5, 6}, image // Universal object file. -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=UOF %s +// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=UOF %s // UOF: 0: input, "{{.*}}phases.c", c // UOF: 1: preprocessor, {0}, cpp-output // UOF: 2: compiler, {1}, assembler @@ -45,33 +45,33 @@ // UOF: 6: lipo, {4, 5}, object // Arch defaulting -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s +// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s // ARCH1: 2: bind-arch, "i386", {1}, object -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2>&1 | FileCheck -check-prefix=ARCH2 %s +// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2>&1 | FileCheck -check-prefix=ARCH2 %s // ARCH2: 2: bind-arch, "x86_64", {1}, object -// RUN: %clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH3 %s +// RUN: %clang -target x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH3 %s // ARCH3: 2: bind-arch, "x86_64", {1}, object -// RUN: %clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2>&1 | FileCheck -check-prefix=ARCH4 %s +// RUN: %clang -target x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2>&1 | FileCheck -check-prefix=ARCH4 %s // ARCH4: 2: bind-arch, "i386", {1}, object // Analyzer -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases --analyze %s 2>&1 | FileCheck -check-prefix=ANALYZE %s +// RUN: %clang -target i386-unknown-unknown -ccc-print-phases --analyze %s 2>&1 | FileCheck -check-prefix=ANALYZE %s // ANALYZE: 0: input, "{{.*}}phases.c", c // ANALYZE: 1: preprocessor, {0}, cpp-output // ANALYZE: 2: analyzer, {1}, plist // Precompiler -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c-header %s 2>&1 | FileCheck -check-prefix=PCH %s +// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -x c-header %s 2>&1 | FileCheck -check-prefix=PCH %s // PCH: 0: input, "{{.*}}phases.c", c-header // PCH: 1: preprocessor, {0}, c-header-cpp-output // PCH: 2: precompiler, {1}, precompiled-header // Darwin overrides the handling for .s // RUN: touch %t.s -// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN1 %s +// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN1 %s // DARWIN1: 0: input, "{{.*}}.s", assembler // DARWIN1: 1: assembler, {0}, object -// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN2 %s +// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN2 %s // DARWIN2: 0: input, "{{.*}}.s", assembler-with-cpp // DARWIN2: 1: preprocessor, {0}, assembler // DARWIN2: 2: assembler, {1}, object diff --git a/test/Driver/pic.c b/test/Driver/pic.c new file mode 100644 index 000000000000..3952f85ceb29 --- /dev/null +++ b/test/Driver/pic.c @@ -0,0 +1,81 @@ +// Test the driver's control over the PIC behavior. These consist of tests of +// the relocation model flags and the pic level flags passed to CC1. +// +// CHECK-NO-PIC: "-mrelocation-model" "static" +// CHECK-NO-PIC-NOT: "-pic-level" +// CHECK-NO-PIC-NOT: "-pie-level" +// +// CHECK-DYNAMIC-NO-PIC1: "-mrelocation-model" "dynamic-no-pic" +// CHECK-DYNAMIC-NO-PIC1: "-pic-level" "1" +// +// CHECK-DYNAMIC-NO-PIC2: "-mrelocation-model" "dynamic-no-pic" +// CHECK-DYNAMIC-NO-PIC2: "-pic-level" "2" +// +// CHECK-PIC1-NOT: "-mrelocation-model" +// CHECK-PIC1: "-pic-level" "1" +// +// CHECK-PIC2-NOT: "-mrelocation-model" +// CHECK-PIC2: "-pic-level" "2" +// +// CHECK-PIE1-NOT: "-mrelocation-model" +// CHECK-PIE1: "-pie-level" "1" +// +// CHECK-PIE2-NOT: "-mrelocation-model" +// CHECK-PIE2: "-pie-level" "2" +// +// RUN: %clang -c %s -target i386-unknown-unknown -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fpic -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIC1 +// RUN: %clang -c %s -target i386-unknown-unknown -fPIC -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIC2 +// RUN: %clang -c %s -target i386-unknown-unknown -fpie -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIE1 +// RUN: %clang -c %s -target i386-unknown-unknown -fPIE -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIE2 +// RUN: %clang -c %s -target i386-unknown-unknown -fpic -fno-pic -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fPIC -fno-PIC -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fpic -fno-PIC -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fPIC -fno-pic -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fpie -fno-pie -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fPIE -fno-PIE -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fpie -fno-PIE -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fPIE -fno-pie -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fpie -fno-pic -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fpic -fno-pie -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -fpic -fPIC -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIC2 +// RUN: %clang -c %s -target i386-unknown-unknown -fPIC -fpic -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIC1 +// RUN: %clang -c %s -target i386-unknown-unknown -fpic -fPIE -fpie -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIE1 +// RUN: %clang -c %s -target i386-unknown-unknown -fpie -fPIC -fPIE -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIE2 +// +// Defaults change for Darwin. +// RUN: %clang -c %s -target i386-apple-darwin -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIC2 +// RUN: %clang -c %s -target i386-apple-darwin -fno-pic -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-apple-darwin -fno-PIC -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// +// Disregard any of the PIC-specific flags if we have a trump-card flag. +// RUN: %clang -c %s -target i386-unknown-unknown -mkernel -fPIC -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -static -fPIC -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC +// RUN: %clang -c %s -target i386-unknown-unknown -mdynamic-no-pic -fPIC -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-DYNAMIC-NO-PIC1 +// RUN: %clang -c %s -target i386-apple-darwin -mdynamic-no-pic -fPIC -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-DYNAMIC-NO-PIC2 diff --git a/test/Driver/prefixed-tools.c b/test/Driver/prefixed-tools.c new file mode 100644 index 000000000000..d7c342a8a94b --- /dev/null +++ b/test/Driver/prefixed-tools.c @@ -0,0 +1,12 @@ +// RUN: %clang -### -B%S/Inputs/prefixed_tools_tree -o %t.o -no-integrated-as \ +// RUN: -target x86_64--linux %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-M64 %s + +// RUN: %clang -### -B%S/Inputs/prefixed_tools_tree -o %t.o -no-integrated-as \ +// RUN: -m32 -target x86_64--linux %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-M32 %s + +// CHECK-M64: "{{.*}}{{[/\\]}}prefixed_tools_tree{{[/\\]}}x86_64--linux-as" +// CHECK-M64: "{{.*}}{{[/\\]}}prefixed_tools_tree{{[/\\]}}x86_64--linux-ld" +// CHECK-M32: "{{.*}}{{[/\\]}}prefixed_tools_tree{{[/\\]}}x86_64--linux-as" +// CHECK-M32: "{{.*}}{{[/\\]}}prefixed_tools_tree{{[/\\]}}x86_64--linux-ld" diff --git a/test/Driver/pth.c b/test/Driver/pth.c index 9c47c5599376..4350f46e86f6 100644 --- a/test/Driver/pth.c +++ b/test/Driver/pth.c @@ -1,12 +1,12 @@ // Test transparent PTH support. -// RUN: %clang -ccc-pch-is-pth -x c-header %s -o %t.h.pth -### 2> %t.log +// RUN: %clang -no-canonical-prefixes -ccc-pch-is-pth -x c-header %s -o %t.h.pth -### 2> %t.log // RUN: FileCheck -check-prefix CHECK1 -input-file %t.log %s // CHECK1: "{{.*}}/clang{{.*}}" "-cc1" {{.*}} "-o" "{{.*}}.h.pth" "-x" "c-header" "{{.*}}pth.c" // RUN: touch %t.h.pth -// RUN: %clang -ccc-pch-is-pth -E -include %t.h %s -### 2> %t.log +// RUN: %clang -no-canonical-prefixes -ccc-pch-is-pth -E -include %t.h %s -### 2> %t.log // RUN: FileCheck -check-prefix CHECK2 -input-file %t.log %s // CHECK2: "{{.*}}/clang{{.*}}" "-cc1" {{.*}}"-include-pth" "{{.*}}.h.pth" {{.*}}"-x" "c" "{{.*}}pth.c" diff --git a/test/Driver/redundant-args.c b/test/Driver/redundant-args.c new file mode 100644 index 000000000000..7bf98e1e737b --- /dev/null +++ b/test/Driver/redundant-args.c @@ -0,0 +1,2 @@ +// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: -Werror -x c -x c -fsyntax-only %s diff --git a/test/Driver/redzone.c b/test/Driver/redzone.c index 9f117d0489bd..7d6d42467952 100644 --- a/test/Driver/redzone.c +++ b/test/Driver/redzone.c @@ -1,6 +1,6 @@ -// RUN: %clang -ccc-host-triple i386-unknown-unknown -mno-red-zone %s -S -emit-llvm -o %t.log +// RUN: %clang -target i386-unknown-unknown -mno-red-zone %s -S -emit-llvm -o %t.log // RUN: grep 'noredzone' %t.log -// RUN: %clang -ccc-host-triple i386-unknown-unknown -mred-zone %s -S -emit-llvm -o %t.log +// RUN: %clang -target i386-unknown-unknown -mred-zone %s -S -emit-llvm -o %t.log // RUN: grep -v 'noredzone' %t.log int foo() { return 42; } diff --git a/test/Driver/rewrite-legacy-objc.m b/test/Driver/rewrite-legacy-objc.m new file mode 100644 index 000000000000..af59ff672726 --- /dev/null +++ b/test/Driver/rewrite-legacy-objc.m @@ -0,0 +1,15 @@ +// RUN: %clang -no-canonical-prefixes -target x86_64-apple-macosx10.7.0 -rewrite-legacy-objc %s -o - -### 2>&1 | \ +// RUN: FileCheck -check-prefix=TEST0 %s +// TEST0: clang{{.*}}" "-cc1" +// TEST0: "-rewrite-objc" +// FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead. +// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime-has-arc" "-fobjc-runtime-has-weak" "-fobjc-fragile-abi" "-fobjc-default-synthesize-properties" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option" +// TEST0: rewrite-legacy-objc.m" + +// RUN: not %clang -ccc-no-clang -target unknown -rewrite-legacy-objc %s -o - -### 2>&1 | \ +// RUN: FileCheck -check-prefix=TEST1 %s +// TEST1: invalid output type 'rewritten-legacy-objc' for use with gcc + +// RUN: not %clang -ccc-no-clang -target i386-apple-darwin10 -rewrite-legacy-objc %s -o - -### 2>&1 | \ +// RUN: FileCheck -check-prefix=TEST2 %s +// TEST2: invalid output type 'rewritten-legacy-objc' for use with gcc diff --git a/test/Driver/rewrite-objc.m b/test/Driver/rewrite-objc.m index 80190917c9c2..7b080fc35e86 100644 --- a/test/Driver/rewrite-objc.m +++ b/test/Driver/rewrite-objc.m @@ -1,15 +1,15 @@ -// RUN: %clang -ccc-host-triple x86_64-apple-macosx10.7.0 -rewrite-objc %s -o - -### 2>&1 | \ +// RUN: %clang -no-canonical-prefixes -target x86_64-apple-macosx10.7.0 -rewrite-objc %s -o - -### 2>&1 | \ // RUN: FileCheck -check-prefix=TEST0 %s // TEST0: clang{{.*}}" "-cc1" // TEST0: "-rewrite-objc" // FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead. -// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-fblocks" "-fobjc-fragile-abi" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option" +// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime-has-arc" "-fobjc-runtime-has-weak" "-fobjc-dispatch-method=mixed" "-fobjc-default-synthesize-properties" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option" // TEST0: rewrite-objc.m" -// RUN: not %clang -ccc-no-clang -ccc-host-triple unknown -rewrite-objc %s -o - -### 2>&1 | \ +// RUN: not %clang -ccc-no-clang -target unknown -rewrite-objc %s -o - -### 2>&1 | \ // RUN: FileCheck -check-prefix=TEST1 %s // TEST1: invalid output type 'rewritten-objc' for use with gcc -// RUN: not %clang -ccc-no-clang -ccc-host-triple i386-apple-darwin10 -rewrite-objc %s -o - -### 2>&1 | \ +// RUN: not %clang -ccc-no-clang -target i386-apple-darwin10 -rewrite-objc %s -o - -### 2>&1 | \ // RUN: FileCheck -check-prefix=TEST2 %s // TEST2: invalid output type 'rewritten-objc' for use with gcc diff --git a/test/Driver/stackrealign.c b/test/Driver/stackrealign.c new file mode 100644 index 000000000000..c5221d652422 --- /dev/null +++ b/test/Driver/stackrealign.c @@ -0,0 +1,12 @@ +// RUN: %clang -### %s 2>&1 | FileCheck %s -check-prefix=NORMAL +// NORMAL-NOT: -force-align-stack +// NORMAL: -mstackrealign + +// RUN: %clang -### -mstackrealign %s 2>&1 | FileCheck %s -check-prefix=MREALIGN +// MREALIGN: -force-align-stack +// MREALIGN: -mstackrealign + +// RUN: %clang -### -mno-stackrealign %s 2>&1 | \ +// RUN: FileCheck %s -check-prefix=MNOREALIGN +// MNOREALIGN-NOT: -force-align-stack +// MNOREALIGN-NOT: -mstackrealign diff --git a/test/Driver/sysroot-flags.c b/test/Driver/sysroot-flags.c index 044a86f6331b..b0a10bfca442 100644 --- a/test/Driver/sysroot-flags.c +++ b/test/Driver/sysroot-flags.c @@ -6,7 +6,7 @@ // Check that we get both isysroot for headers, and pass --sysroot on to GCC to // produce the final binary. -// RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu \ +// RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | \ // RUN: FileCheck %s -check-prefix=SYSROOT_EQ // SYSROOT_EQ: "-isysroot" "{{[^"]*}}/foo/bar" @@ -14,14 +14,14 @@ // Check for overriding the header sysroot by providing both --sysroot and // -isysroot. -// RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu -isysroot /baz \ +// RUN: %clang -### -target x86_64-unknown-linux-gnu -isysroot /baz \ // RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | FileCheck %s \ // RUN: -check-prefix=ISYSROOT_AND_SYSROOT // ISYSROOT_AND_SYSROOT: "-isysroot" "{{[^"]*}}/baz" // ISYSROOT_AND_SYSROOT: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar" // Check that omitting the equals works as well. -// RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu \ +// RUN: %clang -### -target x86_64-unknown-linux-gnu \ // RUN: --sysroot /foo/bar -o /dev/null %s 2>&1 | \ // RUN: FileCheck %s -check-prefix=SYSROOT_SEPARATE // SYSROOT_SEPARATE: "-isysroot" "{{[^"]*}}/foo/bar" diff --git a/test/Driver/sysroot.c b/test/Driver/sysroot.c index 79db900d07e2..3080f76e0316 100644 --- a/test/Driver/sysroot.c +++ b/test/Driver/sysroot.c @@ -1,18 +1,18 @@ // Check that --sysroot= also applies to header search paths. -// RUN: %clang -ccc-host-triple i386-unk-unk --sysroot=/FOO -### -E %s 2> %t1 +// RUN: %clang -target i386-unk-unk --sysroot=/FOO -### -E %s 2> %t1 // RUN: FileCheck --check-prefix=CHECK-SYSROOTEQ < %t1 %s // CHECK-SYSROOTEQ: "-cc1"{{.*}} "-isysroot" "{{[^"]*}}/FOO" // Apple Darwin uses -isysroot as the syslib root, too. // RUN: touch %t2.o -// RUN: %clang -ccc-host-triple i386-apple-darwin10 \ +// RUN: %clang -target i386-apple-darwin10 \ // RUN: -isysroot /FOO -### %t2.o 2> %t2 // RUN: FileCheck --check-prefix=CHECK-APPLE-ISYSROOT < %t2 %s // CHECK-APPLE-ISYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "{{[^"]*}}/FOO" // Check that honor --sysroot= over -isysroot, for Apple Darwin. // RUN: touch %t3.o -// RUN: %clang -ccc-host-triple i386-apple-darwin10 \ +// RUN: %clang -target i386-apple-darwin10 \ // RUN: -isysroot /FOO --sysroot=/BAR -### %t3.o 2> %t3 // RUN: FileCheck --check-prefix=CHECK-APPLE-SYSROOT < %t3 %s // CHECK-APPLE-SYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "{{[^"]*}}/BAR" diff --git a/test/Driver/target.c b/test/Driver/target.c new file mode 100644 index 000000000000..59147e0fbffd --- /dev/null +++ b/test/Driver/target.c @@ -0,0 +1,11 @@ +// RUN: %clang -no-canonical-prefixes -target unknown-unknown-unknown -c %s \ +// RUN: -o %t.o -### 2>&1 | FileCheck %s +// +// Ensure we get a crazy triple here as we asked for one. +// CHECK: Target: unknown-unknown-unknown +// +// Also, ensure we don't blindly hand our target selection logic down to GCC. +// CHECK: "{{.*gcc(\.[Ee][Xx][Ee])?}}" +// CHECK-NOT: "-target" +// CHECK-NOT: "unknown-unknown-unknown" +// CHECK: "-x" "assembler" diff --git a/test/Driver/tsan.c b/test/Driver/tsan.c new file mode 100644 index 000000000000..1dadb8ea265b --- /dev/null +++ b/test/Driver/tsan.c @@ -0,0 +1,8 @@ +// RUN: %clang -target i386-unknown-unknown -fthread-sanitizer %s -S -emit-llvm -o - | FileCheck %s +// RUN: %clang -O1 -target i386-unknown-unknown -fthread-sanitizer %s -S -emit-llvm -o - | FileCheck %s +// RUN: %clang -O2 -target i386-unknown-unknown -fthread-sanitizer %s -S -emit-llvm -o - | FileCheck %s +// RUN: %clang -O3 -target i386-unknown-unknown -fthread-sanitizer %s -S -emit-llvm -o - | FileCheck %s +// Verify that -fthread-sanitizer invokes tsan instrumentation. + +int foo(int *a) { return *a; } +// CHECK: __tsan_init diff --git a/test/Driver/unknown-arg.c b/test/Driver/unknown-arg.c new file mode 100644 index 000000000000..5d0f7afc5113 --- /dev/null +++ b/test/Driver/unknown-arg.c @@ -0,0 +1,4 @@ +// RUN: not %clang_cc1 %s -cake-is-lie 2> %t.log +// RUN: FileCheck %s -input-file=%t.log + +// CHECK: unknown argument diff --git a/test/Driver/unknown-gcc-arch.c b/test/Driver/unknown-gcc-arch.c index 7018bf839d02..5e4746babdda 100644 --- a/test/Driver/unknown-gcc-arch.c +++ b/test/Driver/unknown-gcc-arch.c @@ -1,8 +1,8 @@ -// RUN: %clang -ccc-host-triple x86_64-unknown-unknown -c -x assembler %s -### 2> %t.log +// RUN: %clang -target x86_64-unknown-unknown -c -x assembler %s -### 2> %t.log // RUN: grep '.*gcc.*"-m64"' %t.log -// RUN: %clang -ccc-host-triple x86_64-unknown-unknown -c -x assembler %s -### -m32 2> %t.log +// RUN: %clang -target x86_64-unknown-unknown -c -x assembler %s -### -m32 2> %t.log // RUN: grep '.*gcc.*"-m32"' %t.log -// RUN: %clang -ccc-host-triple i386-unknown-unknown -c -x assembler %s -### 2> %t.log +// RUN: %clang -target i386-unknown-unknown -c -x assembler %s -### 2> %t.log // RUN: grep '.*gcc.*"-m32"' %t.log -// RUN: %clang -ccc-host-triple i386-unknown-unknown -c -x assembler %s -### -m64 2> %t.log +// RUN: %clang -target i386-unknown-unknown -c -x assembler %s -### -m64 2> %t.log // RUN: grep '.*gcc.*"-m64"' %t.log diff --git a/test/Driver/working-directory.c b/test/Driver/working-directory.c new file mode 100644 index 000000000000..38a87a6402af --- /dev/null +++ b/test/Driver/working-directory.c @@ -0,0 +1,4 @@ +// RUN: %clang -ccc-print-options -working-directory "C:\Test" input 2>&1 | FileCheck %s +// CHECK: Option 0 - Name: "-ccc-print-options", Values: {} +// CHECK: Option 1 - Name: "-working-directory", Values: {"C:\Test"} +// CHECK: Option 2 - Name: "<input>", Values: {"input"} diff --git a/test/Driver/x86_features.c b/test/Driver/x86_features.c index 0db372ec64f1..5c65e31ff45c 100644 --- a/test/Driver/x86_features.c +++ b/test/Driver/x86_features.c @@ -1,3 +1,3 @@ -// RUN: %clang -ccc-host-triple i386-unknown-unknown -### -S %s -msse -msse4 -mno-sse -mno-mmx -msse 2> %t +// RUN: %clang -target i386-unknown-unknown -### -S %s -msse -msse4 -mno-sse -mno-mmx -msse 2> %t // RUN: grep '"pentium4" "-target-feature" "+sse4" "-target-feature" "-mmx" "-target-feature" "+sse"' %t // Note that we filter out all but the last -m(no)sse. |
