diff options
author | dim <dim@FreeBSD.org> | 2011-12-09 18:30:42 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-12-09 18:30:42 +0000 |
commit | dc04cb328508e61aad809d9b53b12f9799a00e7d (patch) | |
tree | 81d5fcacdf8f076da7b2359bb7d62be6a453f0da /test | |
parent | 3963a48221351c61c17fb3f382341ab04809a3d3 (diff) | |
download | FreeBSD-src-dc04cb328508e61aad809d9b53b12f9799a00e7d.zip FreeBSD-src-dc04cb328508e61aad809d9b53b12f9799a00e7d.tar.gz |
Vendor import of clang 3.0 final release:
http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_30/final@145349
Diffstat (limited to 'test')
20 files changed, 58 insertions, 13 deletions
diff --git a/test/Analysis/iterators.cpp b/test/Analysis/iterators.cpp index 741970a..1b6340b 100644 --- a/test/Analysis/iterators.cpp +++ b/test/Analysis/iterators.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.cplusplus.Iterators -verify %s +// RUN: %clang --analyze -Xclang -analyzer-checker=core,experimental.cplusplus.Iterators -Xclang -verify %s // XFAIL: win32 #include <vector> diff --git a/test/Analysis/security-syntax-checks.m b/test/Analysis/security-syntax-checks.m index 6fb5b3c..a04401b 100644 --- a/test/Analysis/security-syntax-checks.m +++ b/test/Analysis/security-syntax-checks.m @@ -170,7 +170,7 @@ void test_strcat() { //===----------------------------------------------------------------------=== typedef int __int32_t; typedef __int32_t pid_t; -pid_t vfork(void); //expected-warning{{declaration of built-in function 'vfork' requires inclusion of the header <setjmp.h>}} +pid_t vfork(void); void test_vfork() { vfork(); //expected-warning{{Call to function 'vfork' is insecure as it can lead to denial of service situations in the parent process.}} diff --git a/test/CodeGen/pr9614.c b/test/CodeGen/pr9614.c new file mode 100644 index 0000000..8c76776 --- /dev/null +++ b/test/CodeGen/pr9614.c @@ -0,0 +1,22 @@ +// RUN: %clang_cc1 -emit-llvm %s -O1 -o - | FileCheck %s + +extern void foo_alias (void) __asm ("foo"); +inline void foo (void) { + return foo_alias (); +} +extern void bar_alias (void) __asm ("bar"); +inline __attribute__ ((__always_inline__)) void bar (void) { + return bar_alias (); +} +void f(void) { + foo(); + bar(); +} + +// CHECK: define void @f() +// CHECK: call void @foo() +// CHECK-NEXT: call void @bar() +// CHECK-NEXT: ret void + +// CHECK: declare void @foo() +// CHECK: declare void @bar() diff --git a/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.6.99/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.6.99/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.6.99/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.6/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.6/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.6/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.7.0/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.7.0/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.7.0/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.7.1/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.7.1/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing1/lib/gcc/i386-unknown-linux/4.7.1/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.6.99/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.6.99/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.6.99/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.6.x/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.6.x/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.6.x/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.7.0/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.7.0/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.7.0/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.7.1/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.7.1/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing2/lib/gcc/i386-unknown-linux/4.7.1/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing3/lib/gcc/i386-unknown-linux/4.7.98/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing3/lib/gcc/i386-unknown-linux/4.7.98/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing3/lib/gcc/i386-unknown-linux/4.7.98/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing4/bin/.keep b/test/Driver/Inputs/gcc_version_parsing4/bin/.keep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing4/bin/.keep diff --git a/test/Driver/Inputs/gcc_version_parsing4/lib/gcc/i386-unknown-linux/4.7.98/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing4/lib/gcc/i386-unknown-linux/4.7.98/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing4/lib/gcc/i386-unknown-linux/4.7.98/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing4/lib/gcc/i386-unknown-linux/4.7.99-rc5/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing4/lib/gcc/i386-unknown-linux/4.7.99-rc5/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing4/lib/gcc/i386-unknown-linux/4.7.99-rc5/crtbegin.o diff --git a/test/Driver/Inputs/gcc_version_parsing4/lib/gcc/i386-unknown-linux/4.7.99/crtbegin.o b/test/Driver/Inputs/gcc_version_parsing4/lib/gcc/i386-unknown-linux/4.7.99/crtbegin.o new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Driver/Inputs/gcc_version_parsing4/lib/gcc/i386-unknown-linux/4.7.99/crtbegin.o diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c index 46fbe7f..456f7ad 100644 --- a/test/Driver/linux-ld.c +++ b/test/Driver/linux-ld.c @@ -137,3 +137,11 @@ // CHECK-GCC-VERSION3: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // 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: -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" diff --git a/test/PCH/reloc.c b/test/PCH/reloc.c index fd78feb..5d51eee 100644 --- a/test/PCH/reloc.c +++ b/test/PCH/reloc.c @@ -1,6 +1,8 @@ -// RUN: %clang_cc1 -emit-pch -o %t -relocatable-pch -isysroot %S/libroot %S/libroot/usr/include/reloc.h -// RUN: %clang_cc1 -include-pch %t -isysroot %S/libroot %s -verify -// RUN: not %clang_cc1 -include-pch %t %s +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 --relocatable-pch -o %t \ +// RUN: -isysroot %S/libroot %S/libroot/usr/include/reloc.h +// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -fsyntax-only \ +// RUN: -include-pch %t -isysroot %S/libroot %s -Xclang -verify +// RUN: not %clang -ccc-host-triple x86_64-apple-darwin10 -include-pch %t %s #include <reloc.h> @@ -8,7 +10,5 @@ int x = 2; // expected-error{{redefinition}} int y = 5; // expected-error{{redefinition}} - - // expected-note{{previous definition}} // expected-note{{previous definition}} diff --git a/test/Preprocessor/header_lookup1.c b/test/Preprocessor/header_lookup1.c index f52e4fe..d090936 100644 --- a/test/Preprocessor/header_lookup1.c +++ b/test/Preprocessor/header_lookup1.c @@ -1,2 +1,2 @@ -// RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3.*4' +// RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3' #include <stddef.h> diff --git a/test/lit.cfg b/test/lit.cfg index 8062aa7..1f4a845 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -2,6 +2,9 @@ import os import platform +import re +import subprocess + # Configuration file for the 'lit' test runner. @@ -141,7 +144,23 @@ if lit.useValgrind: config.clang = inferClang(config.environment['PATH']).replace('\\', '/') if not lit.quiet: lit.note('using clang: %r' % config.clang) -config.substitutions.append( ('%clang_cc1', config.clang + ' -cc1') ) + +# Note that when substituting %clang_cc1 also fill in the include directory of +# the builtin headers. Those are part of even a freestanding environment, but +# Clang relies on the driver to locate them. +def getClangBuiltinIncludeDir(clang): + # FIXME: Rather than just getting the version, we should have clang print + # out its resource dir here in an easy to scrape form. + cmd = subprocess.Popen([clang, '-print-file-name=include'], + stdout=subprocess.PIPE) + if not cmd.stdout: + lit.fatal("Couldn't find the include dir for Clang ('%s')" % clang) + return cmd.stdout.read().strip() + +config.substitutions.append( ('%clang_cc1', '%s -cc1 -internal-isystem %s' + % (config.clang, + getClangBuiltinIncludeDir(config.clang))) ) + config.substitutions.append( ('%clangxx', ' ' + config.clang + ' -ccc-clang-cxx -ccc-cxx ')) config.substitutions.append( ('%clang', ' ' + config.clang + ' ') ) @@ -175,10 +194,6 @@ if platform.system() not in ['Windows'] or lit.getBashPath() != '': config.available_features.add('shell') # Registered Targets -import subprocess -import re -import os - def getRegisteredTargets(tool): set_of_targets = set() |