diff --git a/easybuild/easyconfigs/c/CMake/CMake-2.8.11-GCC-4.8.1.eb b/easybuild/easyconfigs/c/CMake/CMake-2.8.11-GCC-4.8.1.eb new file mode 100644 index 000000000000..b76602bb5c25 --- /dev/null +++ b/easybuild/easyconfigs/c/CMake/CMake-2.8.11-GCC-4.8.1.eb @@ -0,0 +1,20 @@ +name = 'CMake' +version = '2.8.11' + +homepage = 'http://www.cmake.org' +description = """CMake, the cross-platform, open-source build system. + CMake is a family of tools designed to build, test and package software.""" + +toolchain = {'name': 'GCC', 'version': '4.8.1'} + +source_urls = ['http://www.cmake.org/files/v%(version_major_minor)s'] +sources = [SOURCELOWER_TAR_GZ] + +dependencies = [('ncurses', '5.9')] + +sanity_check_paths = { + 'files': ["bin/%s" % x for x in ['cmake', 'cpack', 'ctest']], + 'dirs': [], +} + +moduleclass = 'devel' diff --git a/easybuild/easyconfigs/c/Clang/Clang-3.2-GCC-4.7.3.eb b/easybuild/easyconfigs/c/Clang/Clang-3.2-GCC-4.7.3.eb index 37301f1d7e19..97bcb333be6d 100644 --- a/easybuild/easyconfigs/c/Clang/Clang-3.2-GCC-4.7.3.eb +++ b/easybuild/easyconfigs/c/Clang/Clang-3.2-GCC-4.7.3.eb @@ -19,13 +19,13 @@ include C++ standard library -- use libstdc++ from GCC.""" toolchain = {'name': 'GCC', 'version': '4.7.3'} sources = [ - "llvm-%s.src.tar.gz" % version, - "clang-%s.src.tar.gz" % version, - "compiler-rt-%s.src.tar.gz" % version, + "llvm-%(version)s.src.tar.gz", + "clang-%(version)s.src.tar.gz", + "compiler-rt-%(version)s.src.tar.gz", ] source_urls = [ - "http://llvm.org/releases/%s" % version + "http://llvm.org/releases/%(version)s", ] # Remove some tests that fail because of -DGCC_INSTALL_PREFIX. The issue is diff --git a/easybuild/easyconfigs/c/Clang/Clang-3.3-GCC-4.8.1.eb b/easybuild/easyconfigs/c/Clang/Clang-3.3-GCC-4.8.1.eb new file mode 100644 index 000000000000..de5999a42537 --- /dev/null +++ b/easybuild/easyconfigs/c/Clang/Clang-3.3-GCC-4.8.1.eb @@ -0,0 +1,55 @@ +## +# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild +# +# Copyright:: Copyright 2013 Dmitri Gribenko, Ward Poelmans +# Authors:: Dmitri Gribenko +# Authors:: Ward Poelmans +# License:: GPLv2 or later, MIT, three-clause BSD. +# $Id$ +## + +name = "Clang" +version = "3.3" + +homepage = "http://clang.llvm.org/" +description = """C, C++, Objective-C compiler, based on LLVM. Does not + include C++ standard library -- use libstdc++ from GCC.""" + +# Clang also depends on libstdc++ during runtime, but this dependency is +# already specified as the toolchain. +toolchain = {'name': 'GCC', 'version': '4.8.1'} + +sources = [ + "llvm-%(version)s.src.tar.gz", + "cfe-%(version)s.src.tar.gz", + "compiler-rt-%(version)s.src.tar.gz", +] + +source_urls = [ + "http://llvm.org/releases/%(version)s", +] + +patches = [ +# Remove some tests that fail because of -DGCC_INSTALL_PREFIX. The issue is +# that hardcoded GCC_INSTALL_PREFIX overrides -sysroot. This probably breaks +# cross-compilation. +# http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130401/077539.html + 'Clang-3.3-failing-tests-due-to-gcc-installation-prefix.patch', +# Several asan and tsan tests fail due to 32<->64 bit issues. This patch disables them. + 'Clang-3.3-failing-asan-and-tsan-tests.patch', +] + +builddependencies = [('CMake', '2.8.11')] + +sanity_check_paths = { + 'files': ['bin/clang', 'bin/clang++', 'lib/libclang.so', 'lib/clang/%(version)s/include/stddef.h'], + 'dirs': [], +} + +languages = ['c', 'c++'] + +moduleclass = 'compiler' + +assertions = False + +build_targets = ['X86'] diff --git a/easybuild/easyconfigs/c/Clang/Clang-3.3-failing-asan-and-tsan-tests.patch b/easybuild/easyconfigs/c/Clang/Clang-3.3-failing-asan-and-tsan-tests.patch new file mode 100644 index 000000000000..f52a51dc4510 --- /dev/null +++ b/easybuild/easyconfigs/c/Clang/Clang-3.3-failing-asan-and-tsan-tests.patch @@ -0,0 +1,2307 @@ +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/allow_user_segv.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/allow_user_segv.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/allow_user_segv.cc 2013-04-25 12:52:15.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/allow_user_segv.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,42 +0,0 @@ +-// Regression test for +-// https://code.google.com/p/address-sanitizer/issues/detail?id=180 +- +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && ASAN_OPTIONS=allow_user_segv_handler=true %t 2>&1 | FileCheck %s +- +-#include +-#include +- +-struct sigaction user_sigaction; +-struct sigaction original_sigaction; +- +-void User_OnSIGSEGV(int signum, siginfo_t *siginfo, void *context) { +- fprintf(stderr, "User sigaction called\n"); +- if (original_sigaction.sa_flags | SA_SIGINFO) +- original_sigaction.sa_sigaction(signum, siginfo, context); +- else +- original_sigaction.sa_handler(signum); +-} +- +-int DoSEGV() { +- volatile int *x = 0; +- return *x; +-} +- +-int main() { +- user_sigaction.sa_sigaction = User_OnSIGSEGV; +- user_sigaction.sa_flags = SA_SIGINFO; +- if (sigaction(SIGSEGV, &user_sigaction, &original_sigaction)) { +- perror("sigaction"); +- return 1; +- } +- fprintf(stderr, "User sigaction installed\n"); +- return DoSEGV(); +-} +- +-// CHECK: User sigaction installed +-// CHECK-NEXT: User sigaction called +-// CHECK-NEXT: ASAN:SIGSEGV +-// CHECK: AddressSanitizer: SEGV on unknown address +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/blacklist.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/blacklist.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/blacklist.cc 2012-12-07 23:21:21.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/blacklist.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,44 +0,0 @@ +-// Test the blacklist functionality of ASan +- +-// RUN: echo "fun:*brokenFunction*" > %tmp +-// RUN: echo "global:*badGlobal*" >> %tmp +-// RUN: echo "src:*blacklist-extra.cc" >> %tmp +-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m64 -O0 %s -o %t \ +-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1 +-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m64 -O1 %s -o %t \ +-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1 +-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m64 -O2 %s -o %t \ +-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1 +-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m64 -O3 %s -o %t \ +-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1 +-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m32 -O0 %s -o %t \ +-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1 +-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m32 -O1 %s -o %t \ +-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1 +-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m32 -O2 %s -o %t \ +-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1 +-// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -m32 -O3 %s -o %t \ +-// RUN: %p/Helpers/blacklist-extra.cc && %t 2>&1 +- +-// badGlobal is accessed improperly, but we blacklisted it. +-int badGlobal; +-int readBadGlobal() { +- return (&badGlobal)[1]; +-} +- +-// A function which is broken, but excluded in the blacklist. +-int brokenFunction(int argc) { +- char x[10] = {0}; +- return x[argc * 10]; // BOOM +-} +- +-// This function is defined in Helpers/blacklist-extra.cc, a source file which +-// is blacklisted by name +-int externalBrokenFunction(int x); +- +-int main(int argc, char **argv) { +- brokenFunction(argc); +- int x = readBadGlobal(); +- externalBrokenFunction(argc); +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/deep_stack_uaf.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/deep_stack_uaf.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/deep_stack_uaf.cc 2012-12-21 09:53:59.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/deep_stack_uaf.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,36 +0,0 @@ +-// Check that we can store lots of stack frames if asked to. +- +-// RUN: %clangxx_asan -m64 -O0 %s -o %t 2>&1 +-// RUN: ASAN_OPTIONS=malloc_context_size=120:redzone=512 %t 2>&1 | \ +-// RUN: %symbolize | FileCheck %s +- +-// RUN: %clangxx_asan -m32 -O0 %s -o %t 2>&1 +-// RUN: ASAN_OPTIONS=malloc_context_size=120:redzone=512 %t 2>&1 | \ +-// RUN: %symbolize | FileCheck %s +-#include +-#include +- +-template +-struct DeepFree { +- static void free(char *x) { +- DeepFree::free(x); +- } +-}; +- +-template<> +-struct DeepFree<0> { +- static void free(char *x) { +- ::free(x); +- } +-}; +- +-int main() { +- char *x = (char*)malloc(10); +- // deep_free(x); +- DeepFree<200>::free(x); +- return x[5]; +- // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} +- // CHECK: DeepFree<36> +- // CHECK: DeepFree<98> +- // CHECK: DeepFree<115> +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/deep_tail_call.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/deep_tail_call.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/deep_tail_call.cc 2012-10-15 15:04:58.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/deep_tail_call.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,24 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-// CHECK: AddressSanitizer: global-buffer-overflow +-int global[10]; +-// CHECK: {{#0.*call4}} +-void __attribute__((noinline)) call4(int i) { global[i+10]++; } +-// CHECK: {{#1.*call3}} +-void __attribute__((noinline)) call3(int i) { call4(i); } +-// CHECK: {{#2.*call2}} +-void __attribute__((noinline)) call2(int i) { call3(i); } +-// CHECK: {{#3.*call1}} +-void __attribute__((noinline)) call1(int i) { call2(i); } +-// CHECK: {{#4.*main}} +-int main(int argc, char **argv) { +- call1(argc); +- return global[0]; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/deep_thread_stack.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/deep_thread_stack.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/deep_thread_stack.cc 2012-10-15 15:04:58.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/deep_thread_stack.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,61 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-#include +- +-int *x; +- +-void *AllocThread(void *arg) { +- x = new int; +- *x = 42; +- return NULL; +-} +- +-void *FreeThread(void *arg) { +- delete x; +- return NULL; +-} +- +-void *AccessThread(void *arg) { +- *x = 43; // BOOM +- return NULL; +-} +- +-typedef void* (*callback_type)(void* arg); +- +-void *RunnerThread(void *function) { +- pthread_t thread; +- pthread_create(&thread, NULL, (callback_type)function, NULL); +- pthread_join(thread, NULL); +- return NULL; +-} +- +-void RunThread(callback_type function) { +- pthread_t runner; +- pthread_create(&runner, NULL, RunnerThread, (void*)function); +- pthread_join(runner, NULL); +-} +- +-int main(int argc, char *argv[]) { +- RunThread(AllocThread); +- RunThread(FreeThread); +- RunThread(AccessThread); +- return (x != 0); +-} +- +-// CHECK: AddressSanitizer: heap-use-after-free +-// CHECK: WRITE of size 4 at 0x{{.*}} thread T[[ACCESS_THREAD:[0-9]+]] +-// CHECK: freed by thread T[[FREE_THREAD:[0-9]+]] here: +-// CHECK: previously allocated by thread T[[ALLOC_THREAD:[0-9]+]] here: +-// CHECK: Thread T[[ACCESS_THREAD]] created by T[[ACCESS_RUNNER:[0-9]+]] here: +-// CHECK: Thread T[[ACCESS_RUNNER]] created by T0 here: +-// CHECK: Thread T[[FREE_THREAD]] created by T[[FREE_RUNNER:[0-9]+]] here: +-// CHECK: Thread T[[FREE_RUNNER]] created by T0 here: +-// CHECK: Thread T[[ALLOC_THREAD]] created by T[[ALLOC_RUNNER:[0-9]+]] here: +-// CHECK: Thread T[[ALLOC_RUNNER]] created by T0 here: +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/dlclose-test.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/dlclose-test.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/dlclose-test.cc 2012-08-15 13:26:57.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/dlclose-test.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,88 +0,0 @@ +-// Regression test for +-// http://code.google.com/p/address-sanitizer/issues/detail?id=19 +-// Bug description: +-// 1. application dlopens foo.so +-// 2. asan registers all globals from foo.so +-// 3. application dlcloses foo.so +-// 4. application mmaps some memory to the location where foo.so was before +-// 5. application starts using this mmaped memory, but asan still thinks there +-// are globals. +-// 6. BOOM +- +-// RUN: %clangxx_asan -m64 -O0 %p/SharedLibs/dlclose-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %p/SharedLibs/dlclose-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %p/SharedLibs/dlclose-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %p/SharedLibs/dlclose-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %p/SharedLibs/dlclose-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %p/SharedLibs/dlclose-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %p/SharedLibs/dlclose-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %p/SharedLibs/dlclose-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | FileCheck %s +- +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-using std::string; +- +-static const int kPageSize = 4096; +- +-typedef int *(fun_t)(); +- +-int main(int argc, char *argv[]) { +- string path = string(argv[0]) + "-so.so"; +- printf("opening %s ... \n", path.c_str()); +- void *lib = dlopen(path.c_str(), RTLD_NOW); +- if (!lib) { +- printf("error in dlopen(): %s\n", dlerror()); +- return 1; +- } +- fun_t *get = (fun_t*)dlsym(lib, "get_address_of_static_var"); +- if (!get) { +- printf("failed dlsym\n"); +- return 1; +- } +- int *addr = get(); +- assert(((size_t)addr % 32) == 0); // should be 32-byte aligned. +- printf("addr: %p\n", addr); +- addr[0] = 1; // make sure we can write there. +- +- // Now dlclose the shared library. +- printf("attempting to dlclose\n"); +- if (dlclose(lib)) { +- printf("failed to dlclose\n"); +- return 1; +- } +- // Now, the page where 'addr' is unmapped. Map it. +- size_t page_beg = ((size_t)addr) & ~(kPageSize - 1); +- void *res = mmap((void*)(page_beg), kPageSize, +- PROT_READ | PROT_WRITE, +- MAP_PRIVATE | MAP_ANON | MAP_FIXED | MAP_NORESERVE, 0, 0); +- if (res == (char*)-1L) { +- printf("failed to mmap\n"); +- return 1; +- } +- addr[1] = 2; // BOOM (if the bug is not fixed). +- printf("PASS\n"); +- // CHECK: PASS +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/global-overflow.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/global-overflow.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/global-overflow.cc 2012-12-28 09:38:09.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/global-overflow.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,25 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-#include +-int main(int argc, char **argv) { +- static char XXX[10]; +- static char YYY[10]; +- static char ZZZ[10]; +- memset(XXX, 0, 10); +- memset(YYY, 0, 10); +- memset(ZZZ, 0, 10); +- int res = YYY[argc * 10]; // BOOOM +- // CHECK: {{READ of size 1 at 0x.* thread T0}} +- // CHECK: {{ #0 0x.* in _?main .*global-overflow.cc:}}[[@LINE-2]] +- // CHECK: {{0x.* is located 0 bytes to the right of global variable}} +- // CHECK: {{.*YYY.* of size 10}} +- res += XXX[argc] + ZZZ[argc]; +- return res; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/heap-overflow.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/heap-overflow.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/heap-overflow.cc 2013-01-22 10:14:54.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/heap-overflow.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,36 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +- +-#include +-#include +-int main(int argc, char **argv) { +- char *x = (char*)malloc(10 * sizeof(char)); +- memset(x, 0, 10); +- int res = x[argc * 10]; // BOOOM +- // CHECK: {{READ of size 1 at 0x.* thread T0}} +- // CHECK: {{ #0 0x.* in _?main .*heap-overflow.cc:}}[[@LINE-2]] +- // CHECK: {{0x.* is located 0 bytes to the right of 10-byte region}} +- // CHECK: {{allocated by thread T0 here:}} +- +- // CHECK-Linux: {{ #0 0x.* in .*malloc}} +- // CHECK-Linux: {{ #1 0x.* in main .*heap-overflow.cc:21}} +- +- // CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}} +- // CHECK-Darwin: {{ #1 0x.* in _?main .*heap-overflow.cc:21}} +- free(x); +- return res; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/initialization-blacklist.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/initialization-blacklist.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/initialization-blacklist.cc 2013-04-11 15:21:41.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/initialization-blacklist.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,47 +0,0 @@ +-// Test for blacklist functionality of initialization-order checker. +- +-// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-blacklist-extra.cc\ +-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \ +-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \ +-// RUN: -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-blacklist-extra.cc\ +-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \ +-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \ +-// RUN: -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-blacklist-extra.cc\ +-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \ +-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \ +-// RUN: -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-blacklist-extra.cc\ +-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \ +-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \ +-// RUN: -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-blacklist-extra.cc\ +-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \ +-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \ +-// RUN: -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-blacklist-extra.cc\ +-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \ +-// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \ +-// RUN: -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +- +-// Function is defined in another TU. +-int readBadGlobal(); +-int x = readBadGlobal(); // init-order bug. +- +-// Function is defined in another TU. +-int accessBadObject(); +-int y = accessBadObject(); // init-order bug. +- +-int readBadSrcGlobal(); +-int z = readBadSrcGlobal(); // init-order bug. +- +-int main(int argc, char **argv) { +- return argc + x + y + z - 1; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/initialization-bug.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/initialization-bug.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/initialization-bug.cc 2013-03-14 13:43:03.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/initialization-bug.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,46 +0,0 @@ +-// Test to make sure basic initialization order errors are caught. +- +-// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-bug-extra2.cc -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 \ +-// RUN: | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-bug-extra2.cc -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 \ +-// RUN: | %symbolize | FileCheck %s +- +-// Do not test with optimization -- the error may be optimized away. +- +-#include +- +-// The structure of the test is: +-// "x", "y", "z" are dynamically initialized globals. +-// Value of "x" depends on "y", value of "y" depends on "z". +-// "x" and "z" are defined in this TU, "y" is defined in another one. +-// Thus we shoud stably report initialization order fiasco independently of +-// the translation unit order. +- +-int initZ() { +- return 5; +-} +-int z = initZ(); +- +-// 'y' is a dynamically initialized global residing in a different TU. This +-// dynamic initializer will read the value of 'y' before main starts. The +-// result is undefined behavior, which should be caught by initialization order +-// checking. +-extern int y; +-int __attribute__((noinline)) initX() { +- return y + 1; +- // CHECK: {{AddressSanitizer: initialization-order-fiasco}} +- // CHECK: {{READ of size .* at 0x.* thread T0}} +- // CHECK: {{0x.* is located 0 bytes inside of global variable .*(y|z).*}} +-} +- +-// This initializer begins our initialization order problems. +-static int x = initX(); +- +-int main() { +- // ASan should have caused an exit before main runs. +- printf("PASS\n"); +- // CHECK-NOT: PASS +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/initialization-constexpr.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/initialization-constexpr.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/initialization-constexpr.cc 2013-04-05 09:51:49.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/initialization-constexpr.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,43 +0,0 @@ +-// Constexpr: +-// We need to check that a global variable initialized with a constexpr +-// constructor can be accessed during dynamic initialization (as a constexpr +-// constructor implies that it was initialized during constant initialization, +-// not dynamic initialization). +- +-// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-constexpr-extra.cc\ +-// RUN: --std=c++11 -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-constexpr-extra.cc\ +-// RUN: --std=c++11 -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-constexpr-extra.cc\ +-// RUN: --std=c++11 -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m64 -O3 %s %p/Helpers/initialization-constexpr-extra.cc\ +-// RUN: --std=c++11 -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-constexpr-extra.cc\ +-// RUN: --std=c++11 -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-constexpr-extra.cc\ +-// RUN: --std=c++11 -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-constexpr-extra.cc\ +-// RUN: --std=c++11 -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O3 %s %p/Helpers/initialization-constexpr-extra.cc\ +-// RUN: --std=c++11 -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +- +-class Integer { +- private: +- int value; +- +- public: +- constexpr Integer(int x = 0) : value(x) {} +- int getValue() {return value;} +-}; +-Integer coolestInteger(42); +-int getCoolestInteger() { return coolestInteger.getValue(); } +- +-int main() { return 0; } +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/initialization-nobug.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/initialization-nobug.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/initialization-nobug.cc 2013-04-05 09:51:49.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/initialization-nobug.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,56 +0,0 @@ +-// A collection of various initializers which shouldn't trip up initialization +-// order checking. If successful, this will just return 0. +- +-// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m64 -O3 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +-// RUN: %clangxx_asan -m32 -O3 %s %p/Helpers/initialization-nobug-extra.cc -fsanitize=init-order -o %t +-// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 +- +-// Simple access: +-// Make sure that accessing a global in the same TU is safe +- +-bool condition = true; +-int initializeSameTU() { +- return condition ? 0x2a : 052; +-} +-int sameTU = initializeSameTU(); +- +-// Linker initialized: +-// Check that access to linker initialized globals originating from a different +-// TU's initializer is safe. +- +-int A = (1 << 1) + (1 << 3) + (1 << 5), B; +-int getAB() { +- return A * B; +-} +- +-// Function local statics: +-// Check that access to function local statics originating from a different +-// TU's initializer is safe. +- +-int countCalls() { +- static int calls; +- return ++calls; +-} +- +-// Trivial constructor, non-trivial destructor. +-struct StructWithDtor { +- ~StructWithDtor() { } +- int value; +-}; +-StructWithDtor struct_with_dtor; +-int getStructWithDtorValue() { return struct_with_dtor.value; } +- +-int main() { return 0; } +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/large_func_test.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/large_func_test.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/large_func_test.cc 2013-02-21 17:54:09.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/large_func_test.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,63 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +- +-#include +-__attribute__((noinline)) +-static void LargeFunction(int *x, int zero) { +- x[0]++; +- x[1]++; +- x[2]++; +- x[3]++; +- x[4]++; +- x[5]++; +- x[6]++; +- x[7]++; +- x[8]++; +- x[9]++; +- +- // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}} +- // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} +- // CHECK: {{READ of size 4 at 0x.* thread T0}} +- x[zero + 103]++; // we should report this exact line +- // atos incorrectly extracts the symbol name for the static functions on +- // Darwin. +- // CHECK-Linux: {{#0 0x.* in LargeFunction.*large_func_test.cc:}}[[@LINE-3]] +- // CHECK-Darwin: {{#0 0x.* in .*LargeFunction.*large_func_test.cc}}:[[@LINE-4]] +- +- x[10]++; +- x[11]++; +- x[12]++; +- x[13]++; +- x[14]++; +- x[15]++; +- x[16]++; +- x[17]++; +- x[18]++; +- x[19]++; +-} +- +-int main(int argc, char **argv) { +- int *x = new int[100]; +- LargeFunction(x, argc - 1); +- // CHECK: {{ #1 0x.* in _?main .*large_func_test.cc:}}[[@LINE-1]] +- // CHECK: {{0x.* is located 12 bytes to the right of 400-byte region}} +- // CHECK: {{allocated by thread T0 here:}} +- // CHECK-Linux: {{ #0 0x.* in operator new.*}} +- // CHECK-Darwin: {{ #0 0x.* in .*_Zna.*}} +- // CHECK: {{ #1 0x.* in _?main .*large_func_test.cc:}}[[@LINE-7]] +- delete x; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/clone_test.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/clone_test.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/clone_test.cc 2012-08-29 17:48:14.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/clone_test.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,48 +0,0 @@ +-// Regression test for: +-// http://code.google.com/p/address-sanitizer/issues/detail?id=37 +- +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t | FileCheck %s +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-int Child(void *arg) { +- char x[32] = {0}; // Stack gets poisoned. +- printf("Child: %p\n", x); +- _exit(1); // NoReturn, stack will remain unpoisoned unless we do something. +-} +- +-int main(int argc, char **argv) { +- const int kStackSize = 1 << 20; +- char child_stack[kStackSize + 1]; +- char *sp = child_stack + kStackSize; // Stack grows down. +- printf("Parent: %p\n", sp); +- pid_t clone_pid = clone(Child, sp, CLONE_FILES | CLONE_VM, NULL, 0, 0, 0); +- int status; +- pid_t wait_result = waitpid(clone_pid, &status, __WCLONE); +- if (wait_result < 0) { +- perror("waitpid"); +- return 0; +- } +- if (wait_result == clone_pid && WIFEXITED(status)) { +- // Make sure the child stack was indeed unpoisoned. +- for (int i = 0; i < kStackSize; i++) +- child_stack[i] = i; +- int ret = child_stack[argc - 1]; +- printf("PASSED\n"); +- // CHECK: PASSED +- return ret; +- } +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/glob.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/glob.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/glob.cc 2013-04-09 13:35:13.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/glob.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,30 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t %p 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t %p 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t %p 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t %p 2>&1 | FileCheck %s +- +-#include +-#include +-#include +-#include +-#include +-#include +- +- +-int main(int argc, char *argv[]) { +- std::string path = argv[1]; +- std::string pattern = path + "/glob_test_root/*a"; +- printf("pattern: %s\n", pattern.c_str()); +- +- glob_t globbuf; +- int res = glob(pattern.c_str(), 0, 0, &globbuf); +- +- printf("%d %s\n", errno, strerror(errno)); +- assert(res == 0); +- assert(globbuf.gl_pathc == 2); +- printf("%zu\n", strlen(globbuf.gl_pathv[0])); +- printf("%zu\n", strlen(globbuf.gl_pathv[1])); +- printf("PASS\n"); +- // CHECK: PASS +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/heavy_uar_test.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/heavy_uar_test.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/heavy_uar_test.cc 2013-04-11 20:27:02.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/heavy_uar_test.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,55 +0,0 @@ +-// RUN: %clangxx_asan -fsanitize=use-after-return -m64 -O0 %s -o %t && \ +-// RUN: %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -fsanitize=use-after-return -m64 -O2 %s -o %t && \ +-// RUN: %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -fsanitize=use-after-return -m32 -O2 %s -o %t && \ +-// RUN: %t 2>&1 | %symbolize | FileCheck %s +- +-#include +-#include +-#include +- +-__attribute__((noinline)) +-char *pretend_to_do_something(char *x) { +- __asm__ __volatile__("" : : "r" (x) : "memory"); +- return x; +-} +- +-__attribute__((noinline)) +-char *LeakStack() { +- char x[1024]; +- memset(x, 0, sizeof(x)); +- return pretend_to_do_something(x); +-} +- +-template +-__attribute__((noinline)) +-void RecuriveFunctionWithStackFrame(int depth) { +- if (depth <= 0) return; +- char x[kFrameSize]; +- x[0] = depth; +- pretend_to_do_something(x); +- RecuriveFunctionWithStackFrame(depth - 1); +-} +- +-int main(int argc, char **argv) { +- int n_iter = argc >= 2 ? atoi(argv[1]) : 1000; +- int depth = argc >= 3 ? atoi(argv[2]) : 500; +- for (int i = 0; i < n_iter; i++) { +- RecuriveFunctionWithStackFrame<10>(depth); +- RecuriveFunctionWithStackFrame<100>(depth); +- RecuriveFunctionWithStackFrame<500>(depth); +- RecuriveFunctionWithStackFrame<1024>(depth); +- RecuriveFunctionWithStackFrame<2000>(depth); +- RecuriveFunctionWithStackFrame<5000>(depth); +- RecuriveFunctionWithStackFrame<10000>(depth); +- } +- char *stale_stack = LeakStack(); +- RecuriveFunctionWithStackFrame<1024>(10); +- stale_stack[100]++; +- // CHECK: ERROR: AddressSanitizer: stack-use-after-return on address +- // CHECK: is located in stack of thread T0 at offset 132 in frame +- // CHECK: in LeakStack(){{.*}}heavy_uar_test.cc: +- // CHECK: [32, 1056) 'x' +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_failure_test.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_failure_test.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_failure_test.cc 2012-08-15 13:26:57.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_failure_test.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,26 +0,0 @@ +-// If user provides his own libc functions, ASan doesn't +-// intercept these functions. +- +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +- +-extern "C" long strtol(const char *nptr, char **endptr, int base) { +- fprintf(stderr, "my_strtol_interceptor\n"); +- return 0; +-} +- +-int main() { +- char *x = (char*)malloc(10 * sizeof(char)); +- free(x); +- return (int)strtol(x, 0, 10); +- // CHECK: my_strtol_interceptor +- // CHECK-NOT: heap-use-after-free +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_malloc_test.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_malloc_test.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_malloc_test.cc 2012-08-15 13:26:57.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_malloc_test.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,27 +0,0 @@ +-// ASan interceptor can be accessed with __interceptor_ prefix. +- +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +- +-extern "C" void *__interceptor_malloc(size_t size); +-extern "C" void *malloc(size_t size) { +- write(2, "malloc call\n", sizeof("malloc call\n") - 1); +- return __interceptor_malloc(size); +-} +- +-int main() { +- char *x = (char*)malloc(10 * sizeof(char)); +- free(x); +- return (int)strtol(x, 0, 10); +- // CHECK: malloc call +- // CHECK: heap-use-after-free +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_test.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_test.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_test.cc 2012-08-15 13:26:57.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/interception_test.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,26 +0,0 @@ +-// ASan interceptor can be accessed with __interceptor_ prefix. +- +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +- +-extern "C" long __interceptor_strtol(const char *nptr, char **endptr, int base); +-extern "C" long strtol(const char *nptr, char **endptr, int base) { +- fprintf(stderr, "my_strtol_interceptor\n"); +- return __interceptor_strtol(nptr, endptr, base); +-} +- +-int main() { +- char *x = (char*)malloc(10 * sizeof(char)); +- free(x); +- return (int)strtol(x, 0, 10); +- // CHECK: my_strtol_interceptor +- // CHECK: heap-use-after-free +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/swapcontext_test.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/swapcontext_test.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/swapcontext_test.cc 2012-11-23 12:20:54.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/swapcontext_test.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,66 +0,0 @@ +-// Check that ASan plays well with easy cases of makecontext/swapcontext. +- +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | FileCheck %s +- +-#include +-#include +-#include +- +-ucontext_t orig_context; +-ucontext_t child_context; +- +-void Child(int mode) { +- char x[32] = {0}; // Stack gets poisoned. +- printf("Child: %p\n", x); +- // (a) Do nothing, just return to parent function. +- // (b) Jump into the original function. Stack remains poisoned unless we do +- // something. +- if (mode == 1) { +- if (swapcontext(&child_context, &orig_context) < 0) { +- perror("swapcontext"); +- _exit(0); +- } +- } +-} +- +-int Run(int arg, int mode) { +- const int kStackSize = 1 << 20; +- char child_stack[kStackSize + 1]; +- printf("Child stack: %p\n", child_stack); +- // Setup child context. +- getcontext(&child_context); +- child_context.uc_stack.ss_sp = child_stack; +- child_context.uc_stack.ss_size = kStackSize / 2; +- if (mode == 0) { +- child_context.uc_link = &orig_context; +- } +- makecontext(&child_context, (void (*)())Child, 1, mode); +- if (swapcontext(&orig_context, &child_context) < 0) { +- perror("swapcontext"); +- return 0; +- } +- // Touch childs's stack to make sure it's unpoisoned. +- for (int i = 0; i < kStackSize; i++) { +- child_stack[i] = i; +- } +- return child_stack[arg]; +-} +- +-int main(int argc, char **argv) { +- // CHECK: WARNING: ASan doesn't fully support makecontext/swapcontext +- int ret = 0; +- ret += Run(argc - 1, 0); +- printf("Test1 passed\n"); +- // CHECK: Test1 passed +- ret += Run(argc - 1, 1); +- printf("Test2 passed\n"); +- // CHECK: Test2 passed +- return ret; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/zero-base-shadow.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/zero-base-shadow.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/Linux/zero-base-shadow.cc 2013-04-09 09:08:05.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/Linux/zero-base-shadow.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,28 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 -fsanitize-address-zero-base-shadow -fPIE -pie %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-64 < %t.out +-// RUN: %clangxx_asan -m64 -O1 -fsanitize-address-zero-base-shadow -fPIE -pie %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-64 < %t.out +-// RUN: %clangxx_asan -m64 -O2 -fsanitize-address-zero-base-shadow -fPIE -pie %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-64 < %t.out +-// RUN: %clangxx_asan -m32 -O0 -fsanitize-address-zero-base-shadow -fPIE -pie %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-32 < %t.out +-// RUN: %clangxx_asan -m32 -O1 -fsanitize-address-zero-base-shadow -fPIE -pie %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-32 < %t.out +-// RUN: %clangxx_asan -m32 -O2 -fsanitize-address-zero-base-shadow -fPIE -pie %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-32 < %t.out +- +-#include +-int main(int argc, char **argv) { +- char x[10]; +- memset(x, 0, 10); +- int res = x[argc * 10]; // BOOOM +- // CHECK: {{READ of size 1 at 0x.* thread T0}} +- // CHECK: {{ #0 0x.* in _?main .*zero-base-shadow.cc:}}[[@LINE-2]] +- // CHECK: {{Address 0x.* is .* frame}} +- // CHECK: main +- +- // Check that shadow for stack memory occupies lower part of address space. +- // CHECK-64: =>0x0f +- // CHECK-32: =>0x1 +- return res; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/memcmp_test.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/memcmp_test.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/memcmp_test.cc 2012-10-15 15:04:58.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/memcmp_test.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,19 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-#include +-int main(int argc, char **argv) { +- char a1[] = {argc, 2, 3, 4}; +- char a2[] = {1, 2*argc, 3, 4}; +- int res = memcmp(a1, a2, 4 + argc); // BOOM +- // CHECK: AddressSanitizer: stack-buffer-overflow +- // CHECK: {{#0.*memcmp}} +- // CHECK: {{#1.*main}} +- return res; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/null_deref.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/null_deref.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/null_deref.cc 2012-12-28 09:38:09.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/null_deref.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,31 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +- +-__attribute__((noinline)) +-static void NullDeref(int *ptr) { +- // CHECK: ERROR: AddressSanitizer: SEGV on unknown address +- // CHECK: {{0x0*00028 .*pc 0x.*}} +- // CHECK: {{AddressSanitizer can not provide additional info.}} +- ptr[10]++; // BOOM +- // atos on Mac cannot extract the symbol name correctly. +- // CHECK-Linux: {{ #0 0x.* in NullDeref.*null_deref.cc:}}[[@LINE-2]] +- // CHECK-Darwin: {{ #0 0x.* in .*NullDeref.*null_deref.cc:}}[[@LINE-3]] +-} +-int main() { +- NullDeref((int*)0); +- // CHECK: {{ #1 0x.* in _?main.*null_deref.cc:}}[[@LINE-1]] +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/partial_right.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/partial_right.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/partial_right.cc 2013-02-05 15:32:03.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/partial_right.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,17 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-#include +-int main(int argc, char **argv) { +- volatile int *x = (int*)malloc(2*sizeof(int) + 2); +- int res = x[2]; // BOOOM +- // CHECK: {{READ of size 4 at 0x.* thread T0}} +- // CHECK: [[ADDR:0x[01-9a-fa-f]+]] is located 0 bytes to the right of {{.*}}-byte region [{{.*}},{{.*}}[[ADDR]]) +- return res; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/shared-lib-test.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/shared-lib-test.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/shared-lib-test.cc 2012-12-28 09:38:09.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/shared-lib-test.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,54 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %p/SharedLibs/shared-lib-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %p/SharedLibs/shared-lib-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %p/SharedLibs/shared-lib-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %p/SharedLibs/shared-lib-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %p/SharedLibs/shared-lib-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %p/SharedLibs/shared-lib-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %p/SharedLibs/shared-lib-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %p/SharedLibs/shared-lib-test-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-#include +-#include +-#include +- +-#include +- +-using std::string; +- +-typedef void (fun_t)(int x); +- +-int main(int argc, char *argv[]) { +- string path = string(argv[0]) + "-so.so"; +- printf("opening %s ... \n", path.c_str()); +- void *lib = dlopen(path.c_str(), RTLD_NOW); +- if (!lib) { +- printf("error in dlopen(): %s\n", dlerror()); +- return 1; +- } +- fun_t *inc = (fun_t*)dlsym(lib, "inc"); +- if (!inc) return 1; +- printf("ok\n"); +- inc(1); +- inc(-1); // BOOM +- // CHECK: {{.*ERROR: AddressSanitizer: global-buffer-overflow}} +- // CHECK: {{READ of size 4 at 0x.* thread T0}} +- // CHECK: {{ #0 0x.*}} +- // CHECK: {{ #1 0x.* in _?main .*shared-lib-test.cc:}}[[@LINE-4]] +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/stack-overflow.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/stack-overflow.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/stack-overflow.cc 2013-03-22 11:36:24.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/stack-overflow.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,20 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-#include +-int main(int argc, char **argv) { +- char x[10]; +- memset(x, 0, 10); +- int res = x[argc * 10]; // BOOOM +- // CHECK: {{READ of size 1 at 0x.* thread T0}} +- // CHECK: {{ #0 0x.* in _?main .*stack-overflow.cc:}}[[@LINE-2]] +- // CHECK: {{Address 0x.* is located in stack of thread T0 at offset}} +- // CHECK: main +- return res; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/strncpy-overflow.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/strncpy-overflow.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/strncpy-overflow.cc 2013-02-05 15:32:03.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/strncpy-overflow.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,38 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +- +-#include +-#include +-int main(int argc, char **argv) { +- char *hello = (char*)malloc(6); +- strcpy(hello, "hello"); +- char *short_buffer = (char*)malloc(9); +- strncpy(short_buffer, hello, 10); // BOOM +- // CHECK: {{WRITE of size 10 at 0x.* thread T0}} +- // CHECK-Linux: {{ #0 0x.* in .*strncpy}} +- // CHECK-Darwin: {{ #0 0x.* in _?wrap_strncpy}} +- // CHECK: {{ #1 0x.* in _?main .*strncpy-overflow.cc:}}[[@LINE-4]] +- // CHECK: {{0x.* is located 0 bytes to the right of 9-byte region}} +- // CHECK: {{allocated by thread T0 here:}} +- +- // CHECK-Linux: {{ #0 0x.* in .*malloc}} +- // CHECK-Linux: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-10]] +- +- // CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}} +- // CHECK-Darwin: {{ #1 0x.* in _?main .*strncpy-overflow.cc:}}[[@LINE-13]] +- return short_buffer[8]; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/use-after-free.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/use-after-free.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/use-after-free.cc 2013-01-22 10:14:54.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/use-after-free.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,43 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +- +-#include +-int main() { +- char *x = (char*)malloc(10 * sizeof(char)); +- free(x); +- return x[5]; +- // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} +- // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} +- // CHECK: {{READ of size 1 at 0x.* thread T0}} +- // CHECK: {{ #0 0x.* in _?main .*use-after-free.cc:22}} +- // CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}} +- // CHECK: {{freed by thread T0 here:}} +- +- // CHECK-Linux: {{ #0 0x.* in .*free}} +- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:21}} +- +- // CHECK-Darwin: {{ #0 0x.* in _?wrap_free}} +- // CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free.cc:21}} +- +- // CHECK: {{previously allocated by thread T0 here:}} +- +- // CHECK-Linux: {{ #0 0x.* in .*malloc}} +- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:20}} +- +- // CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}} +- // CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free.cc:20}} +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/use-after-free-right.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/use-after-free-right.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/use-after-free-right.cc 2013-02-11 08:19:24.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/use-after-free-right.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,46 +0,0 @@ +-// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +-// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out +- +-// Test use-after-free report in the case when access is at the right border of +-// the allocation. +- +-#include +-int main() { +- volatile char *x = (char*)malloc(sizeof(char)); +- free((void*)x); +- *x = 42; +- // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} +- // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} +- // CHECK: {{WRITE of size 1 at 0x.* thread T0}} +- // CHECK: {{ #0 0x.* in _?main .*use-after-free-right.cc:25}} +- // CHECK: {{0x.* is located 0 bytes inside of 1-byte region .0x.*,0x.*}} +- // CHECK: {{freed by thread T0 here:}} +- +- // CHECK-Linux: {{ #0 0x.* in .*free}} +- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:24}} +- +- // CHECK-Darwin: {{ #0 0x.* in _?wrap_free}} +- // CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free-right.cc:24}} +- +- // CHECK: {{previously allocated by thread T0 here:}} +- +- // CHECK-Linux: {{ #0 0x.* in .*malloc}} +- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:23}} +- +- // CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}} +- // CHECK-Darwin: {{ #1 0x.* in _?main .*use-after-free-right.cc:23}} +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/use-after-scope-inlined.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/use-after-scope-inlined.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/use-after-scope-inlined.cc 2013-03-22 11:36:24.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/use-after-scope-inlined.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,30 +0,0 @@ +-// Test with "-O2" only to make sure inlining (leading to use-after-scope) +-// happens. "always_inline" is not enough, as Clang doesn't emit +-// llvm.lifetime intrinsics at -O0. +-// +-// RUN: %clangxx_asan -m64 -O2 -fsanitize=use-after-scope %s -o %t && \ +-// RUN: %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -m32 -O2 -fsanitize=use-after-scope %s -o %t && \ +-// RUN: %t 2>&1 | %symbolize | FileCheck %s +- +-int *arr; +- +-__attribute__((always_inline)) +-void inlined(int arg) { +- int x[5]; +- for (int i = 0; i < arg; i++) x[i] = i; +- arr = x; +-} +- +-int main(int argc, char *argv[]) { +- inlined(argc); +- return arr[argc - 1]; // BOOM +- // CHECK: ERROR: AddressSanitizer: stack-use-after-scope +- // CHECK: READ of size 4 at 0x{{.*}} thread T0 +- // CHECK: #0 0x{{.*}} in {{_?}}main +- // CHECK: {{.*}}use-after-scope-inlined.cc:[[@LINE-4]] +- // CHECK: Address 0x{{.*}} is located in stack of thread T0 at offset +- // CHECK: [[OFFSET:[^ ]*]] in frame +- // CHECK: main +- // CHECK: {{\[}}[[OFFSET]], {{.*}}) 'x.i' +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/wait.cc llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/wait.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/asan/lit_tests/wait.cc 2013-04-23 14:36:37.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/asan/lit_tests/wait.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,77 +0,0 @@ +-// RUN: %clangxx_asan -DWAIT -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-// RUN: %clangxx_asan -DWAITPID -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAITPID -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAITPID -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAITPID -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-// RUN: %clangxx_asan -DWAITID -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAITID -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAITID -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAITID -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-// RUN: %clangxx_asan -DWAIT3 -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT3 -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT3 -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT3 -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-// RUN: %clangxx_asan -DWAIT4 -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT4 -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT4 -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT4 -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-// RUN: %clangxx_asan -DWAIT3_RUSAGE -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT3_RUSAGE -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT3_RUSAGE -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT3_RUSAGE -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +-// RUN: %clangxx_asan -DWAIT4_RUSAGE -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT4_RUSAGE -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT4_RUSAGE -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +-// RUN: %clangxx_asan -DWAIT4_RUSAGE -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s +- +- +-#include +-#include +-#include +- +-int main(int argc, char **argv) { +- pid_t pid = fork(); +- if (pid) { // parent +- int x[3]; +- int *status = x + argc * 3; +- int res; +-#if defined(WAIT) +- res = wait(status); +-#elif defined(WAITPID) +- res = waitpid(pid, status, WNOHANG); +-#elif defined(WAITID) +- siginfo_t *si = (siginfo_t*)(x + argc * 3); +- res = waitid(P_ALL, 0, si, WEXITED | WNOHANG); +-#elif defined(WAIT3) +- res = wait3(status, WNOHANG, NULL); +-#elif defined(WAIT4) +- res = wait4(pid, status, WNOHANG, NULL); +-#elif defined(WAIT3_RUSAGE) || defined(WAIT4_RUSAGE) +- struct rusage *ru = (struct rusage*)(x + argc * 3); +- int good_status; +-# if defined(WAIT3_RUSAGE) +- res = wait3(&good_status, WNOHANG, ru); +-# elif defined(WAIT4_RUSAGE) +- res = wait4(pid, &good_status, WNOHANG, ru); +-# endif +-#endif +- // CHECK: stack-buffer-overflow +- // CHECK: {{WRITE of size .* at 0x.* thread T0}} +- // CHECK: {{in .*wait}} +- // CHECK: {{in _?main .*wait.cc:}} +- // CHECK: is located in stack of thread T0 at offset +- // CHECK: {{in _?main}} +- return res != -1; +- } +- // child +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/msan/lit_tests/heap-origin.cc llvm-3.3.src/projects/compiler-rt/lib/msan/lit_tests/heap-origin.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/msan/lit_tests/heap-origin.cc 2013-02-11 12:34:26.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/msan/lit_tests/heap-origin.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,33 +0,0 @@ +-// RUN: %clangxx_msan -m64 -O0 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +-// RUN: %clangxx_msan -m64 -O1 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +-// RUN: %clangxx_msan -m64 -O2 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +-// RUN: %clangxx_msan -m64 -O3 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +- +-// RUN: %clangxx_msan -fsanitize-memory-track-origins -m64 -O0 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out +-// RUN: %clangxx_msan -fsanitize-memory-track-origins -m64 -O1 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out +-// RUN: %clangxx_msan -fsanitize-memory-track-origins -m64 -O2 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out +-// RUN: %clangxx_msan -fsanitize-memory-track-origins -m64 -O3 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out +- +-#include +-int main(int argc, char **argv) { +- char *volatile x = (char*)malloc(5 * sizeof(char)); +- if (*x) +- exit(0); +- // CHECK: WARNING: Use of uninitialized value +- // CHECK: {{#0 0x.* in main .*heap-origin.cc:}}[[@LINE-3]] +- +- // CHECK-ORIGINS: Uninitialized value was created by a heap allocation +- // CHECK-ORIGINS: {{#0 0x.* in .*malloc}} +- // CHECK-ORIGINS: {{#1 0x.* in main .*heap-origin.cc:}}[[@LINE-8]] +- +- // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*heap-origin.cc:.* main}} +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/msan/lit_tests/Linux/glob.cc llvm-3.3.src/projects/compiler-rt/lib/msan/lit_tests/Linux/glob.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/msan/lit_tests/Linux/glob.cc 2013-04-09 13:35:13.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/msan/lit_tests/Linux/glob.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,26 +0,0 @@ +-// RUN: %clangxx_msan -m64 -O0 %s -o %t && %t %p 2>&1 | FileCheck %s +-// RUN: %clangxx_msan -m64 -O3 %s -o %t && %t %p 2>&1 | FileCheck %s +- +-#include +-#include +-#include +-#include +-#include +- +-int main(int argc, char *argv[]) { +- assert(argc == 2); +- char buf[1024]; +- snprintf(buf, sizeof(buf), "%s/%s", argv[1], "glob_test_root/*a"); +- +- glob_t globbuf; +- int res = glob(buf, 0, 0, &globbuf); +- +- printf("%d %s\n", errno, strerror(errno)); +- assert(res == 0); +- assert(globbuf.gl_pathc == 2); +- printf("%zu\n", strlen(globbuf.gl_pathv[0])); +- printf("%zu\n", strlen(globbuf.gl_pathv[1])); +- printf("PASS\n"); +- // CHECK: PASS +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/msan/lit_tests/no_sanitize_memory_prop.cc llvm-3.3.src/projects/compiler-rt/lib/msan/lit_tests/no_sanitize_memory_prop.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/msan/lit_tests/no_sanitize_memory_prop.cc 2013-02-28 12:25:54.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/msan/lit_tests/no_sanitize_memory_prop.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,33 +0,0 @@ +-// RUN: %clangxx_msan -m64 -O0 %s -o %t && %t >%t.out 2>&1 +-// RUN: %clangxx_msan -m64 -O1 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +-// RUN: %clangxx_msan -m64 -O2 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +-// RUN: %clangxx_msan -m64 -O3 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +- +-// Test that (no_sanitize_memory) functions propagate shadow. +- +-// Note that at -O0 there is no report, because 'x' in 'f' is spilled to the +-// stack, and then loaded back as a fully initialiazed value (due to +-// no_sanitize_memory attribute). +- +-#include +-#include +- +-__attribute__((noinline)) +-__attribute__((no_sanitize_memory)) +-int f(int x) { +- return x; +-} +- +-int main(void) { +- int x; +- int * volatile p = &x; +- int y = f(*p); +- // CHECK: WARNING: Use of uninitialized value +- // CHECK: {{#0 0x.* in main .*no_sanitize_memory_prop.cc:}}[[@LINE+1]] +- if (y) +- exit(0); +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/msan/lit_tests/stack-origin.cc llvm-3.3.src/projects/compiler-rt/lib/msan/lit_tests/stack-origin.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/msan/lit_tests/stack-origin.cc 2013-02-11 12:34:26.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/msan/lit_tests/stack-origin.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,32 +0,0 @@ +-// RUN: %clangxx_msan -m64 -O0 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +-// RUN: %clangxx_msan -m64 -O1 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +-// RUN: %clangxx_msan -m64 -O2 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +-// RUN: %clangxx_msan -m64 -O3 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out +- +-// RUN: %clangxx_msan -fsanitize-memory-track-origins -m64 -O0 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out +-// RUN: %clangxx_msan -fsanitize-memory-track-origins -m64 -O1 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out +-// RUN: %clangxx_msan -fsanitize-memory-track-origins -m64 -O2 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out +-// RUN: %clangxx_msan -fsanitize-memory-track-origins -m64 -O3 %s -o %t && not %t >%t.out 2>&1 +-// RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out +- +-#include +-int main(int argc, char **argv) { +- int x; +- int *volatile p = &x; +- if (*p) +- exit(0); +- // CHECK: WARNING: Use of uninitialized value +- // CHECK: {{#0 0x.* in main .*stack-origin.cc:}}[[@LINE-3]] +- +- // CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main' +- +- // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*stack-origin.cc:.* main}} +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/blacklist.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/blacklist.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/blacklist.cc 2012-12-28 11:06:26.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/blacklist.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,31 +0,0 @@ +-// Test blacklist functionality for TSan. +- +-// RUN: %clangxx_tsan -O1 %s \ +-// RUN: -fsanitize-blacklist=%p/Helpers/blacklist.txt \ +-// RUN: -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +- +-int Global; +- +-void *Thread1(void *x) { +- Global++; +- return NULL; +-} +- +-void *Blacklisted_Thread2(void *x) { +- Global--; +- return NULL; +-} +- +-int main() { +- pthread_t t[2]; +- pthread_create(&t[0], NULL, Thread1, NULL); +- pthread_create(&t[1], NULL, Blacklisted_Thread2, NULL); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +- printf("PASS\n"); +- return 0; +-} +- +-// CHECK-NOT: ThreadSanitizer: data race +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/load_shared_lib.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/load_shared_lib.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/load_shared_lib.cc 2013-04-09 09:08:05.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/load_shared_lib.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,44 +0,0 @@ +-// Check that if the list of shared libraries changes between the two race +-// reports, the second report occurring in a new shared library is still +-// symbolized correctly. +- +-// RUN: %clangxx_tsan -O1 %p/SharedLibs/load_shared_lib-so.cc \ +-// RUN: -fPIC -shared -o %t-so.so +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +- +-#include +-#include +-#include +- +-#include +- +-int GLOB = 0; +- +-void *write_glob(void *unused) { +- GLOB++; +- return NULL; +-} +- +-void race_two_threads(void *(*access_callback)(void *unused)) { +- pthread_t t1, t2; +- pthread_create(&t1, NULL, access_callback, NULL); +- pthread_create(&t2, NULL, access_callback, NULL); +- pthread_join(t1, NULL); +- pthread_join(t2, NULL); +-} +- +-int main(int argc, char *argv[]) { +- std::string path = std::string(argv[0]) + std::string("-so.so"); +- race_two_threads(write_glob); +- // CHECK: write_glob +- void *lib = dlopen(path.c_str(), RTLD_NOW); +- if (!lib) { +- printf("error in dlopen(): %s\n", dlerror()); +- return 1; +- } +- void *(*write_from_so)(void *unused); +- *(void **)&write_from_so = dlsym(lib, "write_from_so"); +- race_two_threads(write_from_so); +- // CHECK: write_from_so +- return 0; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutex_destroy_locked.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutex_destroy_locked.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutex_destroy_locked.cc 2013-02-06 15:24:00.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutex_destroy_locked.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,22 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +- +-int main() { +- pthread_mutex_t m; +- pthread_mutex_init(&m, 0); +- pthread_mutex_lock(&m); +- pthread_mutex_destroy(&m); +- return 0; +-} +- +-// CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex +-// CHECK: #0 pthread_mutex_destroy +-// CHECK: #1 main +-// CHECK: and: +-// CHECK: #0 pthread_mutex_lock +-// CHECK: #1 main +-// CHECK: Mutex {{.*}} created at: +-// CHECK: #0 pthread_mutex_init +-// CHECK: #1 main +-// CHECK: SUMMARY: ThreadSanitizer: destroy of a locked mutex{{.*}}main +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset1.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset1.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset1.cc 2012-12-28 09:38:09.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset1.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,37 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +- +-int Global; +-pthread_mutex_t mtx; +- +-void *Thread1(void *x) { +- sleep(1); +- pthread_mutex_lock(&mtx); +- Global++; +- pthread_mutex_unlock(&mtx); +- return NULL; +-} +- +-void *Thread2(void *x) { +- Global--; +- return NULL; +-} +- +-int main() { +- // CHECK: WARNING: ThreadSanitizer: data race +- // CHECK: Write of size 4 at {{.*}} by thread T1 +- // CHECK: (mutexes: write [[M1:M[0-9]+]]): +- // CHECK: Previous write of size 4 at {{.*}} by thread T2: +- // CHECK: Mutex [[M1]] created at: +- // CHECK: #0 pthread_mutex_init +- // CHECK: #1 main {{.*}}/mutexset1.cc:[[@LINE+1]] +- pthread_mutex_init(&mtx, 0); +- pthread_t t[2]; +- pthread_create(&t[0], NULL, Thread1, NULL); +- pthread_create(&t[1], NULL, Thread2, NULL); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +- pthread_mutex_destroy(&mtx); +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset2.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset2.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset2.cc 2012-12-28 09:38:09.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset2.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,37 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +- +-int Global; +-pthread_mutex_t mtx; +- +-void *Thread1(void *x) { +- pthread_mutex_lock(&mtx); +- Global++; +- pthread_mutex_unlock(&mtx); +- return NULL; +-} +- +-void *Thread2(void *x) { +- sleep(1); +- Global--; +- return NULL; +-} +- +-int main() { +- // CHECK: WARNING: ThreadSanitizer: data race +- // CHECK: Write of size 4 at {{.*}} by thread T2: +- // CHECK: Previous write of size 4 at {{.*}} by thread T1 +- // CHECK: (mutexes: write [[M1:M[0-9]+]]): +- // CHECK: Mutex [[M1]] created at: +- // CHECK: #0 pthread_mutex_init +- // CHECK: #1 main {{.*}}/mutexset2.cc:[[@LINE+1]] +- pthread_mutex_init(&mtx, 0); +- pthread_t t[2]; +- pthread_create(&t[0], NULL, Thread1, NULL); +- pthread_create(&t[1], NULL, Thread2, NULL); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +- pthread_mutex_destroy(&mtx); +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset3.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset3.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset3.cc 2012-12-28 09:38:09.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset3.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,45 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +- +-int Global; +-pthread_mutex_t mtx1; +-pthread_mutex_t mtx2; +- +-void *Thread1(void *x) { +- sleep(1); +- pthread_mutex_lock(&mtx1); +- pthread_mutex_lock(&mtx2); +- Global++; +- pthread_mutex_unlock(&mtx2); +- pthread_mutex_unlock(&mtx1); +- return NULL; +-} +- +-void *Thread2(void *x) { +- Global--; +- return NULL; +-} +- +-int main() { +- // CHECK: WARNING: ThreadSanitizer: data race +- // CHECK: Write of size 4 at {{.*}} by thread T1 +- // CHECK: (mutexes: write [[M1:M[0-9]+]], write [[M2:M[0-9]+]]): +- // CHECK: Previous write of size 4 at {{.*}} by thread T2: +- // CHECK: Mutex [[M1]] created at: +- // CHECK: #0 pthread_mutex_init +- // CHECK: #1 main {{.*}}/mutexset3.cc:[[@LINE+4]] +- // CHECK: Mutex [[M2]] created at: +- // CHECK: #0 pthread_mutex_init +- // CHECK: #1 main {{.*}}/mutexset3.cc:[[@LINE+2]] +- pthread_mutex_init(&mtx1, 0); +- pthread_mutex_init(&mtx2, 0); +- pthread_t t[2]; +- pthread_create(&t[0], NULL, Thread1, NULL); +- pthread_create(&t[1], NULL, Thread2, NULL); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +- pthread_mutex_destroy(&mtx1); +- pthread_mutex_destroy(&mtx2); +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset4.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset4.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset4.cc 2012-12-28 09:38:09.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset4.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,45 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +- +-int Global; +-pthread_mutex_t mtx1; +-pthread_mutex_t mtx2; +- +-void *Thread1(void *x) { +- pthread_mutex_lock(&mtx1); +- pthread_mutex_lock(&mtx2); +- Global++; +- pthread_mutex_unlock(&mtx2); +- pthread_mutex_unlock(&mtx1); +- return NULL; +-} +- +-void *Thread2(void *x) { +- sleep(1); +- Global--; +- return NULL; +-} +- +-int main() { +- // CHECK: WARNING: ThreadSanitizer: data race +- // CHECK: Write of size 4 at {{.*}} by thread T2: +- // CHECK: Previous write of size 4 at {{.*}} by thread T1 +- // CHECK: (mutexes: write [[M1:M[0-9]+]], write [[M2:M[0-9]+]]): +- // CHECK: Mutex [[M1]] created at: +- // CHECK: #0 pthread_mutex_init +- // CHECK: #1 main {{.*}}/mutexset4.cc:[[@LINE+4]] +- // CHECK: Mutex [[M2]] created at: +- // CHECK: #0 pthread_mutex_init +- // CHECK: #1 main {{.*}}/mutexset4.cc:[[@LINE+2]] +- pthread_mutex_init(&mtx1, 0); +- pthread_mutex_init(&mtx2, 0); +- pthread_t t[2]; +- pthread_create(&t[0], NULL, Thread1, NULL); +- pthread_create(&t[1], NULL, Thread2, NULL); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +- pthread_mutex_destroy(&mtx1); +- pthread_mutex_destroy(&mtx2); +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset5.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset5.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset5.cc 2012-12-28 09:38:09.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset5.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,46 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +- +-int Global; +-pthread_mutex_t mtx1; +-pthread_mutex_t mtx2; +- +-void *Thread1(void *x) { +- sleep(1); +- pthread_mutex_lock(&mtx1); +- Global++; +- pthread_mutex_unlock(&mtx1); +- return NULL; +-} +- +-void *Thread2(void *x) { +- pthread_mutex_lock(&mtx2); +- Global--; +- pthread_mutex_unlock(&mtx2); +- return NULL; +-} +- +-int main() { +- // CHECK: WARNING: ThreadSanitizer: data race +- // CHECK: Write of size 4 at {{.*}} by thread T1 +- // CHECK: (mutexes: write [[M1:M[0-9]+]]): +- // CHECK: Previous write of size 4 at {{.*}} by thread T2 +- // CHECK: (mutexes: write [[M2:M[0-9]+]]): +- // CHECK: Mutex [[M1]] created at: +- // CHECK: #0 pthread_mutex_init +- // CHECK: #1 main {{.*}}/mutexset5.cc:[[@LINE+4]] +- // CHECK: Mutex [[M2]] created at: +- // CHECK: #0 pthread_mutex_init +- // CHECK: #1 main {{.*}}/mutexset5.cc:[[@LINE+5]] +- pthread_mutex_init(&mtx1, 0); +- pthread_mutex_init(&mtx2, 0); +- pthread_t t[2]; +- pthread_create(&t[0], NULL, Thread1, NULL); +- pthread_create(&t[1], NULL, Thread2, NULL); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +- pthread_mutex_destroy(&mtx1); +- pthread_mutex_destroy(&mtx2); +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset6.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset6.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset6.cc 2012-12-28 09:38:09.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset6.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,53 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +- +-int Global; +-pthread_mutex_t mtx1; +-pthread_spinlock_t mtx2; +-pthread_rwlock_t mtx3; +- +-void *Thread1(void *x) { +- sleep(1); +- pthread_mutex_lock(&mtx1); +- Global++; +- pthread_mutex_unlock(&mtx1); +- return NULL; +-} +- +-void *Thread2(void *x) { +- pthread_mutex_lock(&mtx1); +- pthread_mutex_unlock(&mtx1); +- pthread_spin_lock(&mtx2); +- pthread_rwlock_rdlock(&mtx3); +- Global--; +- pthread_spin_unlock(&mtx2); +- pthread_rwlock_unlock(&mtx3); +- return NULL; +-} +- +-int main() { +- // CHECK: WARNING: ThreadSanitizer: data race +- // CHECK: Write of size 4 at {{.*}} by thread T1 +- // CHECK: (mutexes: write [[M1:M[0-9]+]]): +- // CHECK: Previous write of size 4 at {{.*}} by thread T2 +- // CHECK: (mutexes: write [[M2:M[0-9]+]], read [[M3:M[0-9]+]]): +- // CHECK: Mutex [[M1]] created at: +- // CHECK: #1 main {{.*}}/mutexset6.cc:[[@LINE+5]] +- // CHECK: Mutex [[M2]] created at: +- // CHECK: #1 main {{.*}}/mutexset6.cc:[[@LINE+4]] +- // CHECK: Mutex [[M3]] created at: +- // CHECK: #1 main {{.*}}/mutexset6.cc:[[@LINE+3]] +- pthread_mutex_init(&mtx1, 0); +- pthread_spin_init(&mtx2, 0); +- pthread_rwlock_init(&mtx3, 0); +- pthread_t t[2]; +- pthread_create(&t[0], NULL, Thread1, NULL); +- pthread_create(&t[1], NULL, Thread2, NULL); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +- pthread_mutex_destroy(&mtx1); +- pthread_spin_destroy(&mtx2); +- pthread_rwlock_destroy(&mtx3); +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset8.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset8.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/mutexset8.cc 2013-04-30 14:00:40.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/mutexset8.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,39 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +- +-int Global; +-pthread_mutex_t *mtx; +- +-void *Thread1(void *x) { +- sleep(1); +- pthread_mutex_lock(mtx); +- Global++; +- pthread_mutex_unlock(mtx); +- return NULL; +-} +- +-void *Thread2(void *x) { +- Global--; +- return NULL; +-} +- +-int main() { +- // CHECK: WARNING: ThreadSanitizer: data race +- // CHECK: Write of size 4 at {{.*}} by thread T1 +- // CHECK: (mutexes: write [[M1:M[0-9]+]]): +- // CHECK: Previous write of size 4 at {{.*}} by thread T2: +- // CHECK: Mutex [[M1]] created at: +- // CHECK: #0 pthread_mutex_init +- // CHECK: #1 main {{.*}}/mutexset8.cc +- mtx = new pthread_mutex_t; +- pthread_mutex_init(mtx, 0); +- pthread_t t[2]; +- pthread_create(&t[0], NULL, Thread1, NULL); +- pthread_create(&t[1], NULL, Thread2, NULL); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +- pthread_mutex_destroy(mtx); +- delete mtx; +-} +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/race_on_mutex.c llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/race_on_mutex.c +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/race_on_mutex.c 2013-02-01 12:10:53.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/race_on_mutex.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,42 +0,0 @@ +-// RUN: %clang_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +-#include +- +-pthread_mutex_t Mtx; +-int Global; +- +-void *Thread1(void *x) { +- pthread_mutex_init(&Mtx, 0); +- pthread_mutex_lock(&Mtx); +- Global = 42; +- pthread_mutex_unlock(&Mtx); +- return NULL; +-} +- +-void *Thread2(void *x) { +- sleep(1); +- pthread_mutex_lock(&Mtx); +- Global = 43; +- pthread_mutex_unlock(&Mtx); +- return NULL; +-} +- +-int main() { +- pthread_t t[2]; +- pthread_create(&t[0], NULL, Thread1, NULL); +- pthread_create(&t[1], NULL, Thread2, NULL); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +- pthread_mutex_destroy(&Mtx); +- return 0; +-} +- +-// CHECK: WARNING: ThreadSanitizer: data race +-// CHECK-NEXT: Atomic read of size 1 at {{.*}} by thread T2: +-// CHECK-NEXT: #0 pthread_mutex_lock +-// CHECK-NEXT: #1 Thread2{{.*}} {{.*}}race_on_mutex.c:20{{(:3)?}} ({{.*}}) +-// CHECK: Previous write of size 1 at {{.*}} by thread T1: +-// CHECK-NEXT: #0 pthread_mutex_init {{.*}} ({{.*}}) +-// CHECK-NEXT: #1 Thread1{{.*}} {{.*}}race_on_mutex.c:11{{(:3)?}} ({{.*}}) +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/signal_malloc.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/signal_malloc.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/signal_malloc.cc 2013-02-06 15:24:00.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/signal_malloc.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,26 +0,0 @@ +-// RUN: %clang_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +-#include +-#include +- +-static void handler(int, siginfo_t*, void*) { +- // CHECK: WARNING: ThreadSanitizer: signal-unsafe call inside of a signal +- // CHECK: #0 malloc +- // CHECK: #{{(1|2)}} handler(int, siginfo{{(_t)?}}*, void*) {{.*}}signal_malloc.cc:[[@LINE+2]] +- // CHECK: SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal{{.*}}handler +- volatile char *p = (char*)malloc(1); +- p[0] = 0; +- free((void*)p); +-} +- +-int main() { +- struct sigaction act = {}; +- act.sa_sigaction = &handler; +- sigaction(SIGPROF, &act, 0); +- kill(getpid(), SIGPROF); +- sleep(1); +- return 0; +-} +- +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/simple_race.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/simple_race.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/simple_race.cc 2013-02-06 15:24:00.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/simple_race.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,26 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +- +-int Global; +- +-void *Thread1(void *x) { +- Global++; +- return NULL; +-} +- +-void *Thread2(void *x) { +- Global--; +- return NULL; +-} +- +-int main() { +- pthread_t t[2]; +- pthread_create(&t[0], NULL, Thread1, NULL); +- pthread_create(&t[1], NULL, Thread2, NULL); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +-} +- +-// CHECK: WARNING: ThreadSanitizer: data race +-// CHECK: SUMMARY: ThreadSanitizer: data race{{.*}}Thread +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/simple_stack2.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/simple_stack2.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/simple_stack2.cc 2012-12-07 10:24:57.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/simple_stack2.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,53 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +- +-int Global; +- +-void __attribute__((noinline)) foo1() { +- Global = 42; +-} +- +-void __attribute__((noinline)) bar1() { +- volatile int tmp = 42; +- int tmp2 = tmp; +- (void)tmp2; +- foo1(); +-} +- +-void __attribute__((noinline)) foo2() { +- volatile int tmp = Global; +- int tmp2 = tmp; +- (void)tmp2; +-} +- +-void __attribute__((noinline)) bar2() { +- volatile int tmp = 42; +- int tmp2 = tmp; +- (void)tmp2; +- foo2(); +-} +- +-void *Thread1(void *x) { +- sleep(1); +- bar1(); +- return NULL; +-} +- +-int main() { +- pthread_t t; +- pthread_create(&t, NULL, Thread1, NULL); +- bar2(); +- pthread_join(t, NULL); +-} +- +-// CHECK: WARNING: ThreadSanitizer: data race +-// CHECK-NEXT: Write of size 4 at {{.*}} by thread T1: +-// CHECK-NEXT: #0 foo1{{.*}} {{.*}}simple_stack2.cc:9{{(:3)?}} ({{.*}}) +-// CHECK-NEXT: #1 bar1{{.*}} {{.*}}simple_stack2.cc:16{{(:3)?}} ({{.*}}) +-// CHECK-NEXT: #2 Thread1{{.*}} {{.*}}simple_stack2.cc:34{{(:3)?}} ({{.*}}) +-// CHECK: Previous read of size 4 at {{.*}} by main thread: +-// CHECK-NEXT: #0 foo2{{.*}} {{.*}}simple_stack2.cc:20{{(:28)?}} ({{.*}}) +-// CHECK-NEXT: #1 bar2{{.*}} {{.*}}simple_stack2.cc:29{{(:3)?}} ({{.*}}) +-// CHECK-NEXT: #2 main{{.*}} {{.*}}simple_stack2.cc:41{{(:3)?}} ({{.*}}) +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/simple_stack.c llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/simple_stack.c +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/simple_stack.c 2012-12-17 17:28:15.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/simple_stack.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,66 +0,0 @@ +-// RUN: %clang_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +-#include +- +-int Global; +- +-void __attribute__((noinline)) foo1() { +- Global = 42; +-} +- +-void __attribute__((noinline)) bar1() { +- volatile int tmp = 42; (void)tmp; +- foo1(); +-} +- +-void __attribute__((noinline)) foo2() { +- volatile int v = Global; (void)v; +-} +- +-void __attribute__((noinline)) bar2() { +- volatile int tmp = 42; (void)tmp; +- foo2(); +-} +- +-void *Thread1(void *x) { +- sleep(1); +- bar1(); +- return NULL; +-} +- +-void *Thread2(void *x) { +- bar2(); +- return NULL; +-} +- +-void StartThread(pthread_t *t, void *(*f)(void*)) { +- pthread_create(t, NULL, f, NULL); +-} +- +-int main() { +- pthread_t t[2]; +- StartThread(&t[0], Thread1); +- StartThread(&t[1], Thread2); +- pthread_join(t[0], NULL); +- pthread_join(t[1], NULL); +- return 0; +-} +- +-// CHECK: WARNING: ThreadSanitizer: data race +-// CHECK-NEXT: Write of size 4 at {{.*}} by thread T1: +-// CHECK-NEXT: #0 foo1{{.*}} {{.*}}simple_stack.c:9{{(:3)?}} ({{.*}}) +-// CHECK-NEXT: #1 bar1{{.*}} {{.*}}simple_stack.c:14{{(:3)?}} ({{.*}}) +-// CHECK-NEXT: #2 Thread1{{.*}} {{.*}}simple_stack.c:28{{(:3)?}} ({{.*}}) +-// CHECK: Previous read of size 4 at {{.*}} by thread T2: +-// CHECK-NEXT: #0 foo2{{.*}} {{.*}}simple_stack.c:18{{(:26)?}} ({{.*}}) +-// CHECK-NEXT: #1 bar2{{.*}} {{.*}}simple_stack.c:23{{(:3)?}} ({{.*}}) +-// CHECK-NEXT: #2 Thread2{{.*}} {{.*}}simple_stack.c:33{{(:3)?}} ({{.*}}) +-// CHECK: Thread T1 (tid={{.*}}, running) created by main thread at: +-// CHECK-NEXT: #0 pthread_create {{.*}} ({{.*}}) +-// CHECK-NEXT: #1 StartThread{{.*}} {{.*}}simple_stack.c:38{{(:3)?}} ({{.*}}) +-// CHECK-NEXT: #2 main{{.*}} {{.*}}simple_stack.c:43{{(:3)?}} ({{.*}}) +-// CHECK: Thread T2 ({{.*}}) created by main thread at: +-// CHECK-NEXT: #0 pthread_create {{.*}} ({{.*}}) +-// CHECK-NEXT: #1 StartThread{{.*}} {{.*}}simple_stack.c:38{{(:3)?}} ({{.*}}) +-// CHECK-NEXT: #2 main{{.*}} {{.*}}simple_stack.c:44{{(:3)?}} ({{.*}}) +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/thread_leak3.c llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/thread_leak3.c +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/thread_leak3.c 2013-03-21 17:55:17.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/thread_leak3.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,17 +0,0 @@ +-// RUN: %clang_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +- +-void *Thread(void *x) { +- return 0; +-} +- +-int main() { +- pthread_t t; +- pthread_create(&t, 0, Thread, 0); +- sleep(1); +- return 0; +-} +- +-// CHECK: WARNING: ThreadSanitizer: thread leak +-// CHECK: SUMMARY: ThreadSanitizer: thread leak{{.*}}main +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/tiny_race.c llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/tiny_race.c +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/tiny_race.c 2012-09-18 09:23:54.000000000 +0200 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/tiny_race.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,15 +0,0 @@ +-// RUN: %clang_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-int Global; +-void *Thread1(void *x) { +- Global = 42; +- return x; +-} +-int main() { +- pthread_t t; +- pthread_create(&t, NULL, Thread1, NULL); +- Global = 43; +- pthread_join(t, NULL); +- return Global; +-} +-// CHECK: WARNING: ThreadSanitizer: data race +diff -urN llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/write_in_reader_lock.cc llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/write_in_reader_lock.cc +--- llvm-3.3.src.org/projects/compiler-rt/lib/tsan/lit_tests/write_in_reader_lock.cc 2012-12-07 10:24:57.000000000 +0100 ++++ llvm-3.3.src/projects/compiler-rt/lib/tsan/lit_tests/write_in_reader_lock.cc 1970-01-01 01:00:00.000000000 +0100 +@@ -1,35 +0,0 @@ +-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +-#include +-#include +- +-pthread_rwlock_t rwlock; +-int GLOB; +- +-void *Thread1(void *p) { +- (void)p; +- pthread_rwlock_rdlock(&rwlock); +- // Write under reader lock. +- sleep(1); +- GLOB++; +- pthread_rwlock_unlock(&rwlock); +- return 0; +-} +- +-int main(int argc, char *argv[]) { +- pthread_rwlock_init(&rwlock, NULL); +- pthread_rwlock_rdlock(&rwlock); +- pthread_t t; +- pthread_create(&t, 0, Thread1, 0); +- volatile int x = GLOB; +- (void)x; +- pthread_rwlock_unlock(&rwlock); +- pthread_join(t, 0); +- pthread_rwlock_destroy(&rwlock); +- return 0; +-} +- +-// CHECK: WARNING: ThreadSanitizer: data race +-// CHECK: Write of size 4 at {{.*}} by thread T1{{.*}}: +-// CHECK: #0 Thread1(void*) {{.*}}write_in_reader_lock.cc:13 +-// CHECK: Previous read of size 4 at {{.*}} by main thread{{.*}}: +-// CHECK: #0 main {{.*}}write_in_reader_lock.cc:23 diff --git a/easybuild/easyconfigs/c/Clang/Clang-3.3-failing-tests-due-to-gcc-installation-prefix.patch b/easybuild/easyconfigs/c/Clang/Clang-3.3-failing-tests-due-to-gcc-installation-prefix.patch new file mode 100644 index 000000000000..06d2c3fe820e --- /dev/null +++ b/easybuild/easyconfigs/c/Clang/Clang-3.3-failing-tests-due-to-gcc-installation-prefix.patch @@ -0,0 +1,1943 @@ +diff -Nur llvm-3.3.src.orig/tools/clang/test/Driver/constructors.c llvm-3.3.src/tools/clang/test/Driver/constructors.c +--- llvm-3.3.src.orig/tools/clang/test/Driver/constructors.c 2012-11-22 00:40:23.000000000 +0100 ++++ llvm-3.3.src/tools/clang/test/Driver/constructors.c 2013-09-05 14:29:19.521023594 +0200 +@@ -5,11 +5,6 @@ + // CHECK-NO-INIT-ARRAY-NOT: -fuse-init-array + // + // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +-// RUN: -target i386-unknown-linux \ +-// RUN: --sysroot=%S/Inputs/fake_install_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s +-// +-// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ + // RUN: -fno-use-init-array \ + // RUN: -target i386-unknown-linux \ + // RUN: --sysroot=%S/Inputs/fake_install_tree \ +@@ -22,11 +17,6 @@ + // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s + // + // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +-// RUN: -target i386-unknown-linux \ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s +-// +-// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ + // RUN: -fuse-init-array \ + // RUN: -target i386-unknown-linux \ + // RUN: --sysroot=%S/Inputs/basic_linux_tree \ +diff -Nur llvm-3.3.src.orig/tools/clang/test/Driver/hexagon-toolchain.c llvm-3.3.src/tools/clang/test/Driver/hexagon-toolchain.c +--- llvm-3.3.src.orig/tools/clang/test/Driver/hexagon-toolchain.c 2013-04-11 19:27:18.000000000 +0200 ++++ llvm-3.3.src/tools/clang/test/Driver/hexagon-toolchain.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,564 +0,0 @@ +-// REQUIRES: hexagon-registered-target +- +-// ----------------------------------------------------------------------------- +-// Test standard include paths +-// ----------------------------------------------------------------------------- +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK001 %s +-// CHECK001: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include" +-// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed" +-// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include" +-// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK002 %s +-// CHECK002: "-cc1" {{.*}} "-internal-isystem" "[[INSTALL_DIR:.*]]/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0" +-// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include" +-// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed" +-// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include" +-// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// ----------------------------------------------------------------------------- +-// Test -nostdinc, -nostdlibinc, -nostdinc++ +-// ----------------------------------------------------------------------------- +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostdinc \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK003 %s +-// CHECK003: "-cc1" +-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include" +-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed" +-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include" +-// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostdlibinc \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK004 %s +-// CHECK004: "-cc1" +-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include" +-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed" +-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include" +-// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostdlibinc \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK005 %s +-// CHECK005: "-cc1" +-// CHECK005-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0" +-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include" +-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed" +-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include" +-// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostdinc++ \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK006 %s +-// CHECK006: "-cc1" +-// CHECK006-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0" +-// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// ----------------------------------------------------------------------------- +-// Test -march= -mcpu= -mv +-// ----------------------------------------------------------------------------- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -march=hexagonv3 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK007 %s +-// CHECK007: "-cc1" {{.*}} "-target-cpu" "hexagonv3" +-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v3" +-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv3" +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -mcpu=hexagonv5 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK008 %s +-// CHECK008: "-cc1" {{.*}} "-target-cpu" "hexagonv5" +-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v5" +-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv5" +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -mv2 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK009 %s +-// CHECK009: "-cc1" {{.*}} "-target-cpu" "hexagonv2" +-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v2" +-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv2" +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK010 %s +-// CHECK010: "-cc1" {{.*}} "-target-cpu" "hexagonv4" +-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v4" +-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv4" +- +-// RUN: %clang -march=hexagonv2 -target hexagon-unknown-linux \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s +-// RUN: %clang -mcpu=hexagonv2 -target hexagon-unknown-linux \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s +-// RUN: %clang -mv2 -target hexagon-unknown-linux \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s +-// CHECK-UNKNOWN-V2: error: unknown target CPU 'hexagonv2' +- +-// RUN: %clang -march=hexagonv3 -target hexagon-unknown-linux \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s +-// RUN: %clang -mcpu=hexagonv3 -target hexagon-unknown-linux \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s +-// RUN: %clang -mv3 -target hexagon-unknown-linux \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s +-// CHECK-UNKNOWN-V3: error: unknown target CPU 'hexagonv3' +- +-// ----------------------------------------------------------------------------- +-// Test Linker related args +-// ----------------------------------------------------------------------------- +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// Defaults for C +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK011 %s +-// CHECK011: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK011-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK011-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK011-NOT: "-static" +-// CHECK011-NOT: "-shared" +-// CHECK011: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK011: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK011: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK011: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK011: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK011: "-L{{.*}}/lib/gcc" +-// CHECK011: "-L{{.*}}/hexagon/lib/v4" +-// CHECK011: "-L{{.*}}/hexagon/lib" +-// CHECK011: "{{[^"]+}}.o" +-// CHECK011: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" +-// CHECK011: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// Defaults for C++ +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK012 %s +-// CHECK012: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK012-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK012-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK012-NOT: "-static" +-// CHECK012-NOT: "-shared" +-// CHECK012: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK012: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK012: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK012: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK012: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK012: "-L{{.*}}/lib/gcc" +-// CHECK012: "-L{{.*}}/hexagon/lib/v4" +-// CHECK012: "-L{{.*}}/hexagon/lib" +-// CHECK012: "{{[^"]+}}.o" +-// CHECK012: "-lstdc++" "-lm" +-// CHECK012: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" +-// CHECK012: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// Additional Libraries (-L) +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -Lone -L two -L three \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK013 %s +-// CHECK013: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK013-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK013-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK013: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK013: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK013: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK013: "-Lone" "-Ltwo" "-Lthree" +-// CHECK013: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK013: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK013: "-L{{.*}}/lib/gcc" +-// CHECK013: "-L{{.*}}/hexagon/lib/v4" +-// CHECK013: "-L{{.*}}/hexagon/lib" +-// CHECK013: "{{[^"]+}}.o" +-// CHECK013: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" +-// CHECK013: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// -static, -shared +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -static \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK014 %s +-// CHECK014: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK014-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK014-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK014: "-static" +-// CHECK014: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK014: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK014: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK014: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK014: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK014: "-L{{.*}}/lib/gcc" +-// CHECK014: "-L{{.*}}/hexagon/lib/v4" +-// CHECK014: "-L{{.*}}/hexagon/lib" +-// CHECK014: "{{[^"]+}}.o" +-// CHECK014: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" +-// CHECK014: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -shared \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK015 %s +-// CHECK015: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK015-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK015-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK015: "-shared" "-call_shared" +-// CHECK015-NOT: crt0_standalone.o +-// CHECK015-NOT: crt0.o +-// CHECK015: "{{.*}}/hexagon/lib/v4/G0/initS.o" +-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4/G0" +-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/G0" +-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK015: "-L{{.*}}/lib/gcc" +-// CHECK015: "-L{{.*}}/hexagon/lib/v4/G0" +-// CHECK015: "-L{{.*}}/hexagon/lib/G0" +-// CHECK015: "-L{{.*}}/hexagon/lib/v4" +-// CHECK015: "-L{{.*}}/hexagon/lib" +-// CHECK015: "{{[^"]+}}.o" +-// CHECK015: "--start-group" +-// CHECK015-NOT: "-lstandalone" +-// CHECK015-NOT: "-lc" +-// CHECK015: "-lgcc" +-// CHECK015: "--end-group" +-// CHECK015: "{{.*}}/hexagon/lib/v4/G0/finiS.o" +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -shared \ +-// RUN: -static \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK016 %s +-// CHECK016: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK016-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK016-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK016: "-shared" "-call_shared" "-static" +-// CHECK016-NOT: crt0_standalone.o +-// CHECK016-NOT: crt0.o +-// CHECK016: "{{.*}}/hexagon/lib/v4/G0/init.o" +-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4/G0" +-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/G0" +-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK016: "-L{{.*}}/lib/gcc" +-// CHECK016: "-L{{.*}}/hexagon/lib/v4/G0" +-// CHECK016: "-L{{.*}}/hexagon/lib/G0" +-// CHECK016: "-L{{.*}}/hexagon/lib/v4" +-// CHECK016: "-L{{.*}}/hexagon/lib" +-// CHECK016: "{{[^"]+}}.o" +-// CHECK016: "--start-group" +-// CHECK016-NOT: "-lstandalone" +-// CHECK016-NOT: "-lc" +-// CHECK016: "-lgcc" +-// CHECK016: "--end-group" +-// CHECK016: "{{.*}}/hexagon/lib/v4/G0/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// -nostdlib, -nostartfiles, -nodefaultlibs +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostdlib \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK017 %s +-// CHECK017: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK017-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK017-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK017-NOT: crt0_standalone.o +-// CHECK017-NOT: crt0.o +-// CHECK017-NOT: init.o +-// CHECK017: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK017: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK017: "-L{{.*}}/lib/gcc" +-// CHECK017: "-L{{.*}}/hexagon/lib/v4" +-// CHECK017: "-L{{.*}}/hexagon/lib" +-// CHECK017: "{{[^"]+}}.o" +-// CHECK017-NOT: "-lstdc++" +-// CHECK017-NOT: "-lm" +-// CHECK017-NOT: "--start-group" +-// CHECK017-NOT: "-lstandalone" +-// CHECK017-NOT: "-lc" +-// CHECK017-NOT: "-lgcc" +-// CHECK017-NOT: "--end-group" +-// CHECK017-NOT: fini.o +- +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostartfiles \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK018 %s +-// CHECK018: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK018-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK018-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK018-NOT: crt0_standalone.o +-// CHECK018-NOT: crt0.o +-// CHECK018-NOT: init.o +-// CHECK018: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK018: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK018: "-L{{.*}}/lib/gcc" +-// CHECK018: "-L{{.*}}/hexagon/lib/v4" +-// CHECK018: "-L{{.*}}/hexagon/lib" +-// CHECK018: "{{[^"]+}}.o" +-// CHECK018: "-lstdc++" +-// CHECK018: "-lm" +-// CHECK018: "--start-group" +-// CHECK018: "-lstandalone" +-// CHECK018: "-lc" +-// CHECK018: "-lgcc" +-// CHECK018: "--end-group" +-// CHECK018-NOT: fini.o +- +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nodefaultlibs \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK019 %s +-// CHECK019: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK019-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK019-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK019: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK019: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK019: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK019: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK019: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK019: "-L{{.*}}/lib/gcc" +-// CHECK019: "-L{{.*}}/hexagon/lib/v4" +-// CHECK019: "-L{{.*}}/hexagon/lib" +-// CHECK019: "{{[^"]+}}.o" +-// CHECK019-NOT: "-lstdc++" +-// CHECK019-NOT: "-lm" +-// CHECK019-NOT: "--start-group" +-// CHECK019-NOT: "-lstandalone" +-// CHECK019-NOT: "-lc" +-// CHECK019-NOT: "-lgcc" +-// CHECK019-NOT: "--end-group" +-// CHECK019: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// -moslib +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -moslib=first -moslib=second \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK020 %s +-// CHECK020: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK020-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK020-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK020-NOT: "-static" +-// CHECK020-NOT: "-shared" +-// CHECK020-NOT: crt0_standalone.o +-// CHECK020: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK020: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK020: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK020: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK020: "-L{{.*}}/lib/gcc" +-// CHECK020: "-L{{.*}}/hexagon/lib/v4" +-// CHECK020: "-L{{.*}}/hexagon/lib" +-// CHECK020: "{{[^"]+}}.o" +-// CHECK020: "--start-group" +-// CHECK020: "-lfirst" "-lsecond" +-// CHECK020-NOT: "-lstandalone" +-// CHECK020: "-lc" "-lgcc" "--end-group" +-// CHECK020: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -moslib=first -moslib=second -moslib=standalone\ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK021 %s +-// CHECK021: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK021-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK021-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK021-NOT: "-static" +-// CHECK021-NOT: "-shared" +-// CHECK021: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK021: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK021: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK021: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK021: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK021: "-L{{.*}}/lib/gcc" +-// CHECK021: "-L{{.*}}/hexagon/lib/v4" +-// CHECK021: "-L{{.*}}/hexagon/lib" +-// CHECK021: "{{[^"]+}}.o" +-// CHECK021: "--start-group" +-// CHECK021: "-lfirst" "-lsecond" +-// CHECK021: "-lstandalone" +-// CHECK021: "-lc" "-lgcc" "--end-group" +-// CHECK021: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// Other args to pass to linker +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -s \ +-// RUN: -Tbss 0xdead -Tdata 0xbeef -Ttext 0xcafe \ +-// RUN: -t \ +-// RUN: -e start_here \ +-// RUN: -uFoo -undefined Bar \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK022 %s +-// CHECK022: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK022-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK022-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK022: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK022: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK022: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK022: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK022: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK022: "-L{{.*}}/lib/gcc" +-// CHECK022: "-L{{.*}}/hexagon/lib/v4" +-// CHECK022: "-L{{.*}}/hexagon/lib" +-// CHECK022: "-Tbss" "0xdead" "-Tdata" "0xbeef" "-Ttext" "0xcafe" +-// CHECK022: "-s" +-// CHECK022: "-t" +-// CHECK022: "-u" "Foo" "-undefined" "Bar" +-// CHECK022: "{{[^"]+}}.o" +-// CHECK022: "-lstdc++" "-lm" +-// CHECK022: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" +-// CHECK022: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// ----------------------------------------------------------------------------- +-// pic, small data threshold +-// ----------------------------------------------------------------------------- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK023 %s +-// CHECK023: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK023: "-mrelocation-model" "static" +-// CHECK023-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK023-NOT: "-G{{[0-9]+}}" +-// CHECK023-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK023-NOT: "-G{{[0-9]+}}" +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -fpic \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK024 %s +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -fPIC \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK024 %s +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -fPIC \ +-// RUN: -msmall_data_threshold=8 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK024 %s +-// CHECK024: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK024-NOT: "-mrelocation-model" "static" +-// CHECK024: "-pic-level" "{{[12]}}" +-// CHECK024: "-mllvm" "-hexagon-small-data-threshold=0" +-// CHECK024-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK024: "-G0" +-// CHECK024-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK024: "-G0" +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -G=8 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK025 %s +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -G 8 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK025 %s +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -msmall-data-threshold=8 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK025 %s +-// CHECK025: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK025: "-mrelocation-model" "static" +-// CHECK025: "-mllvm" "-hexagon-small-data-threshold=8" +-// CHECK025-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK025: "-G8" +-// CHECK025-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK025: "-G8" +- +-// ----------------------------------------------------------------------------- +-// pie +-// ----------------------------------------------------------------------------- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -pie \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK026 %s +-// CHECK026: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK026-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK026-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK026: "-pie" +- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -pie -shared \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK027 %s +-// CHECK027: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK027-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK027-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK027-NOT: "-pie" +- +-// ----------------------------------------------------------------------------- +-// Misc Defaults +-// ----------------------------------------------------------------------------- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK028 %s +-// CHECK028: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK028: "-mqdsp6-compat" +-// CHECK028: "-Wreturn-type" +-// CHECK028-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK028-NEXT: "{{.*}}/bin/hexagon-ld" +- +-// ----------------------------------------------------------------------------- +-// Test Assembler related args +-// ----------------------------------------------------------------------------- +-// RUN: %clang -### -target hexagon-unknown-linux \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -gdwarf-2 \ +-// RUN: -Wa,--noexecstack,--trap \ +-// RUN: -Xassembler --keep-locals \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK029 %s +-// CHECK029: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK029-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK029: "--noexecstack" "--trap" "--keep-locals" +-// CHECK029-NEXT: "{{.*}}/bin/hexagon-ld" +diff -Nur llvm-3.3.src.orig/tools/clang/test/Driver/hexagon-toolchain-elf.c llvm-3.3.src/tools/clang/test/Driver/hexagon-toolchain-elf.c +--- llvm-3.3.src.orig/tools/clang/test/Driver/hexagon-toolchain-elf.c 2013-04-11 19:27:18.000000000 +0200 ++++ llvm-3.3.src/tools/clang/test/Driver/hexagon-toolchain-elf.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,564 +0,0 @@ +-// REQUIRES: hexagon-registered-target +- +-// ----------------------------------------------------------------------------- +-// Test standard include paths +-// ----------------------------------------------------------------------------- +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK001 %s +-// CHECK001: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include" +-// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed" +-// CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include" +-// CHECK001-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK002 %s +-// CHECK002: "-cc1" {{.*}} "-internal-isystem" "[[INSTALL_DIR:.*]]/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0" +-// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include" +-// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed" +-// CHECK002: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include" +-// CHECK002-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// ----------------------------------------------------------------------------- +-// Test -nostdinc, -nostdlibinc, -nostdinc++ +-// ----------------------------------------------------------------------------- +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostdinc \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK003 %s +-// CHECK003: "-cc1" +-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include" +-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed" +-// CHECK003-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include" +-// CHECK003-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostdlibinc \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK004 %s +-// CHECK004: "-cc1" +-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include" +-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed" +-// CHECK004-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include" +-// CHECK004-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostdlibinc \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK005 %s +-// CHECK005: "-cc1" +-// CHECK005-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0" +-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include" +-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/lib/gcc/hexagon/4.4.0/include-fixed" +-// CHECK005-NOT: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include" +-// CHECK005-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostdinc++ \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK006 %s +-// CHECK006: "-cc1" +-// CHECK006-NOT: "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/hexagon/include/c++/4.4.0" +-// CHECK006-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as" +- +-// ----------------------------------------------------------------------------- +-// Test -march= -mcpu= -mv +-// ----------------------------------------------------------------------------- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -march=hexagonv3 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK007 %s +-// CHECK007: "-cc1" {{.*}} "-target-cpu" "hexagonv3" +-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v3" +-// CHECK007-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv3" +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -mcpu=hexagonv5 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK008 %s +-// CHECK008: "-cc1" {{.*}} "-target-cpu" "hexagonv5" +-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v5" +-// CHECK008-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv5" +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -mv2 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK009 %s +-// CHECK009: "-cc1" {{.*}} "-target-cpu" "hexagonv2" +-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v2" +-// CHECK009-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv2" +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK010 %s +-// CHECK010: "-cc1" {{.*}} "-target-cpu" "hexagonv4" +-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-as"{{.*}} "-march=v4" +-// CHECK010-NEXT: "{{.*}}/Inputs/hexagon_tree/qc/bin/../../gnu/bin/hexagon-ld"{{.*}} "-mv4" +- +-// RUN: %clang -march=hexagonv2 -target hexagon-unknown-elf \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s +-// RUN: %clang -mcpu=hexagonv2 -target hexagon-unknown-elf \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s +-// RUN: %clang -mv2 -target hexagon-unknown-elf \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V2 %s +-// CHECK-UNKNOWN-V2: error: unknown target CPU 'hexagonv2' +- +-// RUN: %clang -march=hexagonv3 -target hexagon-unknown-elf \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s +-// RUN: %clang -mcpu=hexagonv3 -target hexagon-unknown-elf \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s +-// RUN: %clang -mv3 -target hexagon-unknown-elf \ +-// RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-UNKNOWN-V3 %s +-// CHECK-UNKNOWN-V3: error: unknown target CPU 'hexagonv3' +- +-// ----------------------------------------------------------------------------- +-// Test Linker related args +-// ----------------------------------------------------------------------------- +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// Defaults for C +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK011 %s +-// CHECK011: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK011-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK011-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK011-NOT: "-static" +-// CHECK011-NOT: "-shared" +-// CHECK011: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK011: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK011: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK011: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK011: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK011: "-L{{.*}}/lib/gcc" +-// CHECK011: "-L{{.*}}/hexagon/lib/v4" +-// CHECK011: "-L{{.*}}/hexagon/lib" +-// CHECK011: "{{[^"]+}}.o" +-// CHECK011: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" +-// CHECK011: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// Defaults for C++ +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK012 %s +-// CHECK012: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK012-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK012-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK012-NOT: "-static" +-// CHECK012-NOT: "-shared" +-// CHECK012: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK012: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK012: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK012: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK012: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK012: "-L{{.*}}/lib/gcc" +-// CHECK012: "-L{{.*}}/hexagon/lib/v4" +-// CHECK012: "-L{{.*}}/hexagon/lib" +-// CHECK012: "{{[^"]+}}.o" +-// CHECK012: "-lstdc++" "-lm" +-// CHECK012: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" +-// CHECK012: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// Additional Libraries (-L) +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -Lone -L two -L three \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK013 %s +-// CHECK013: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK013-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK013-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK013: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK013: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK013: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK013: "-Lone" "-Ltwo" "-Lthree" +-// CHECK013: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK013: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK013: "-L{{.*}}/lib/gcc" +-// CHECK013: "-L{{.*}}/hexagon/lib/v4" +-// CHECK013: "-L{{.*}}/hexagon/lib" +-// CHECK013: "{{[^"]+}}.o" +-// CHECK013: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" +-// CHECK013: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// -static, -shared +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -static \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK014 %s +-// CHECK014: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK014-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK014-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK014: "-static" +-// CHECK014: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK014: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK014: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK014: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK014: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK014: "-L{{.*}}/lib/gcc" +-// CHECK014: "-L{{.*}}/hexagon/lib/v4" +-// CHECK014: "-L{{.*}}/hexagon/lib" +-// CHECK014: "{{[^"]+}}.o" +-// CHECK014: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" +-// CHECK014: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -shared \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK015 %s +-// CHECK015: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK015-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK015-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK015: "-shared" "-call_shared" +-// CHECK015-NOT: crt0_standalone.o +-// CHECK015-NOT: crt0.o +-// CHECK015: "{{.*}}/hexagon/lib/v4/G0/initS.o" +-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4/G0" +-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/G0" +-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK015: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK015: "-L{{.*}}/lib/gcc" +-// CHECK015: "-L{{.*}}/hexagon/lib/v4/G0" +-// CHECK015: "-L{{.*}}/hexagon/lib/G0" +-// CHECK015: "-L{{.*}}/hexagon/lib/v4" +-// CHECK015: "-L{{.*}}/hexagon/lib" +-// CHECK015: "{{[^"]+}}.o" +-// CHECK015: "--start-group" +-// CHECK015-NOT: "-lstandalone" +-// CHECK015-NOT: "-lc" +-// CHECK015: "-lgcc" +-// CHECK015: "--end-group" +-// CHECK015: "{{.*}}/hexagon/lib/v4/G0/finiS.o" +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -shared \ +-// RUN: -static \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK016 %s +-// CHECK016: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK016-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK016-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK016: "-shared" "-call_shared" "-static" +-// CHECK016-NOT: crt0_standalone.o +-// CHECK016-NOT: crt0.o +-// CHECK016: "{{.*}}/hexagon/lib/v4/G0/init.o" +-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4/G0" +-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/G0" +-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK016: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK016: "-L{{.*}}/lib/gcc" +-// CHECK016: "-L{{.*}}/hexagon/lib/v4/G0" +-// CHECK016: "-L{{.*}}/hexagon/lib/G0" +-// CHECK016: "-L{{.*}}/hexagon/lib/v4" +-// CHECK016: "-L{{.*}}/hexagon/lib" +-// CHECK016: "{{[^"]+}}.o" +-// CHECK016: "--start-group" +-// CHECK016-NOT: "-lstandalone" +-// CHECK016-NOT: "-lc" +-// CHECK016: "-lgcc" +-// CHECK016: "--end-group" +-// CHECK016: "{{.*}}/hexagon/lib/v4/G0/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// -nostdlib, -nostartfiles, -nodefaultlibs +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostdlib \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK017 %s +-// CHECK017: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK017-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK017-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK017-NOT: crt0_standalone.o +-// CHECK017-NOT: crt0.o +-// CHECK017-NOT: init.o +-// CHECK017: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK017: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK017: "-L{{.*}}/lib/gcc" +-// CHECK017: "-L{{.*}}/hexagon/lib/v4" +-// CHECK017: "-L{{.*}}/hexagon/lib" +-// CHECK017: "{{[^"]+}}.o" +-// CHECK017-NOT: "-lstdc++" +-// CHECK017-NOT: "-lm" +-// CHECK017-NOT: "--start-group" +-// CHECK017-NOT: "-lstandalone" +-// CHECK017-NOT: "-lc" +-// CHECK017-NOT: "-lgcc" +-// CHECK017-NOT: "--end-group" +-// CHECK017-NOT: fini.o +- +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nostartfiles \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK018 %s +-// CHECK018: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK018-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK018-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK018-NOT: crt0_standalone.o +-// CHECK018-NOT: crt0.o +-// CHECK018-NOT: init.o +-// CHECK018: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK018: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK018: "-L{{.*}}/lib/gcc" +-// CHECK018: "-L{{.*}}/hexagon/lib/v4" +-// CHECK018: "-L{{.*}}/hexagon/lib" +-// CHECK018: "{{[^"]+}}.o" +-// CHECK018: "-lstdc++" +-// CHECK018: "-lm" +-// CHECK018: "--start-group" +-// CHECK018: "-lstandalone" +-// CHECK018: "-lc" +-// CHECK018: "-lgcc" +-// CHECK018: "--end-group" +-// CHECK018-NOT: fini.o +- +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -nodefaultlibs \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK019 %s +-// CHECK019: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK019-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK019-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK019: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK019: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK019: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK019: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK019: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK019: "-L{{.*}}/lib/gcc" +-// CHECK019: "-L{{.*}}/hexagon/lib/v4" +-// CHECK019: "-L{{.*}}/hexagon/lib" +-// CHECK019: "{{[^"]+}}.o" +-// CHECK019-NOT: "-lstdc++" +-// CHECK019-NOT: "-lm" +-// CHECK019-NOT: "--start-group" +-// CHECK019-NOT: "-lstandalone" +-// CHECK019-NOT: "-lc" +-// CHECK019-NOT: "-lgcc" +-// CHECK019-NOT: "--end-group" +-// CHECK019: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// -moslib +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -moslib=first -moslib=second \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK020 %s +-// CHECK020: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK020-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK020-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK020-NOT: "-static" +-// CHECK020-NOT: "-shared" +-// CHECK020-NOT: crt0_standalone.o +-// CHECK020: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK020: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK020: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK020: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK020: "-L{{.*}}/lib/gcc" +-// CHECK020: "-L{{.*}}/hexagon/lib/v4" +-// CHECK020: "-L{{.*}}/hexagon/lib" +-// CHECK020: "{{[^"]+}}.o" +-// CHECK020: "--start-group" +-// CHECK020: "-lfirst" "-lsecond" +-// CHECK020-NOT: "-lstandalone" +-// CHECK020: "-lc" "-lgcc" "--end-group" +-// CHECK020: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -moslib=first -moslib=second -moslib=standalone\ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK021 %s +-// CHECK021: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK021-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK021-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK021-NOT: "-static" +-// CHECK021-NOT: "-shared" +-// CHECK021: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK021: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK021: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK021: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK021: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK021: "-L{{.*}}/lib/gcc" +-// CHECK021: "-L{{.*}}/hexagon/lib/v4" +-// CHECK021: "-L{{.*}}/hexagon/lib" +-// CHECK021: "{{[^"]+}}.o" +-// CHECK021: "--start-group" +-// CHECK021: "-lfirst" "-lsecond" +-// CHECK021: "-lstandalone" +-// CHECK021: "-lc" "-lgcc" "--end-group" +-// CHECK021: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// Other args to pass to linker +-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +-// RUN: %clang -ccc-cxx -x c++ -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -s \ +-// RUN: -Tbss 0xdead -Tdata 0xbeef -Ttext 0xcafe \ +-// RUN: -t \ +-// RUN: -e start_here \ +-// RUN: -uFoo -undefined Bar \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK022 %s +-// CHECK022: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK022-NEXT: "{{.*}}/bin/hexagon-as"{{.*}} +-// CHECK022-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK022: "{{.*}}/hexagon/lib/v4/crt0_standalone.o" +-// CHECK022: "{{.*}}/hexagon/lib/v4/crt0.o" +-// CHECK022: "{{.*}}/hexagon/lib/v4/init.o" +-// CHECK022: "-L{{.*}}/lib/gcc/hexagon/4.4.0/v4" +-// CHECK022: "-L{{.*}}/lib/gcc/hexagon/4.4.0" +-// CHECK022: "-L{{.*}}/lib/gcc" +-// CHECK022: "-L{{.*}}/hexagon/lib/v4" +-// CHECK022: "-L{{.*}}/hexagon/lib" +-// CHECK022: "-Tbss" "0xdead" "-Tdata" "0xbeef" "-Ttext" "0xcafe" +-// CHECK022: "-s" +-// CHECK022: "-t" +-// CHECK022: "-u" "Foo" "-undefined" "Bar" +-// CHECK022: "{{[^"]+}}.o" +-// CHECK022: "-lstdc++" "-lm" +-// CHECK022: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" +-// CHECK022: "{{.*}}/hexagon/lib/v4/fini.o" +- +-// ----------------------------------------------------------------------------- +-// pic, small data threshold +-// ----------------------------------------------------------------------------- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK023 %s +-// CHECK023: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK023: "-mrelocation-model" "static" +-// CHECK023-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK023-NOT: "-G{{[0-9]+}}" +-// CHECK023-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK023-NOT: "-G{{[0-9]+}}" +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -fpic \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK024 %s +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -fPIC \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK024 %s +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -fPIC \ +-// RUN: -msmall_data_threshold=8 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK024 %s +-// CHECK024: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK024-NOT: "-mrelocation-model" "static" +-// CHECK024: "-pic-level" "{{[12]}}" +-// CHECK024: "-mllvm" "-hexagon-small-data-threshold=0" +-// CHECK024-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK024: "-G0" +-// CHECK024-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK024: "-G0" +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -G=8 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK025 %s +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -G 8 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK025 %s +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -msmall-data-threshold=8 \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK025 %s +-// CHECK025: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK025: "-mrelocation-model" "static" +-// CHECK025: "-mllvm" "-hexagon-small-data-threshold=8" +-// CHECK025-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK025: "-G8" +-// CHECK025-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK025: "-G8" +- +-// ----------------------------------------------------------------------------- +-// pie +-// ----------------------------------------------------------------------------- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -pie \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK026 %s +-// CHECK026: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK026-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK026-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK026: "-pie" +- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -pie -shared \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK027 %s +-// CHECK027: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK027-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK027-NEXT: "{{.*}}/bin/hexagon-ld" +-// CHECK027-NOT: "-pie" +- +-// ----------------------------------------------------------------------------- +-// Misc Defaults +-// ----------------------------------------------------------------------------- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK028 %s +-// CHECK028: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK028: "-mqdsp6-compat" +-// CHECK028: "-Wreturn-type" +-// CHECK028-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK028-NEXT: "{{.*}}/bin/hexagon-ld" +- +-// ----------------------------------------------------------------------------- +-// Test Assembler related args +-// ----------------------------------------------------------------------------- +-// RUN: %clang -### -target hexagon-unknown-elf \ +-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ +-// RUN: -gdwarf-2 \ +-// RUN: -Wa,--noexecstack,--trap \ +-// RUN: -Xassembler --keep-locals \ +-// RUN: %s 2>&1 \ +-// RUN: | FileCheck -check-prefix=CHECK029 %s +-// CHECK029: "{{.*}}clang{{.*}}" "-cc1" +-// CHECK029-NEXT: "{{.*}}/bin/hexagon-as" +-// CHECK029: "--noexecstack" "--trap" "--keep-locals" +-// CHECK029-NEXT: "{{.*}}/bin/hexagon-ld" +diff -Nur llvm-3.3.src.orig/tools/clang/test/Driver/linux-header-search.cpp llvm-3.3.src/tools/clang/test/Driver/linux-header-search.cpp +--- llvm-3.3.src.orig/tools/clang/test/Driver/linux-header-search.cpp 2013-03-06 18:14:05.000000000 +0100 ++++ llvm-3.3.src/tools/clang/test/Driver/linux-header-search.cpp 1970-01-01 01:00:00.000000000 +0100 +@@ -1,103 +0,0 @@ +-// 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" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +-// RUN: -target x86_64-unknown-linux-gnu \ +-// RUN: --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-13-04 %s +-// CHECK-UBUNTU-13-04: "{{[^"]*}}clang{{[^"]*}}" "-cc1" +-// CHECK-UBUNTU-13-04: "-isysroot" "[[SYSROOT:[^"]+]]" +-// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7" +-// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward" +-// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/c++/4.7" +-// CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/local/include" +-// CHECK-UBUNTU-13-04: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include" +-// CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu" +-// CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/include" +-// CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" +-// +-// Test Ubuntu/Debian's new version of multiarch, with -m32. +-// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +-// RUN: -target x86_64-unknown-linux-gnu -m32 \ +-// RUN: --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-13-04-M32 %s +-// CHECK-UBUNTU-13-04-M32: "{{[^"]*}}clang{{[^"]*}}" "-cc1" +-// CHECK-UBUNTU-13-04-M32: "-triple" "i386-unknown-linux-gnu" +-// CHECK-UBUNTU-13-04-M32: "-isysroot" "[[SYSROOT:[^"]+]]" +-// CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7" +-// CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/x86_64-linux-gnu/32" +-// CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward" +-// CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/c++/4.7/32" +-// +-// 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 -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 -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 -Nur llvm-3.3.src.orig/tools/clang/test/Driver/linux-ld.c llvm-3.3.src/tools/clang/test/Driver/linux-ld.c +--- llvm-3.3.src.orig/tools/clang/test/Driver/linux-ld.c 2013-04-14 12:14:21.000000000 +0200 ++++ llvm-3.3.src/tools/clang/test/Driver/linux-ld.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,669 +0,0 @@ +-// General tests that ld invocations on Linux targets sane. Note that we use +-// sysroot to make these tests independent of the host system. +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target i386-unknown-linux \ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s +-// CHECK-LD-32-NOT: warning: +-// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/crtbegin.o" +-// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" +-// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" +-// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." +-// CHECK-LD-32: "-L[[SYSROOT]]/lib" +-// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target x86_64-unknown-linux \ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-LD-64 %s +-// CHECK-LD-64-NOT: warning: +-// CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-LD-64: "--eh-frame-hdr" +-// CHECK-LD-64: "-m" "elf_x86_64" +-// CHECK-LD-64: "-dynamic-linker" +-// CHECK-LD-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o" +-// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" +-// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" +-// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." +-// CHECK-LD-64: "-L[[SYSROOT]]/lib" +-// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib" +-// CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +-// CHECK-LD-64: "-lc" +-// CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target x86_64-unknown-linux \ +-// RUN: -static-libgcc \ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC-LIBGCC %s +-// CHECK-LD-64-STATIC-LIBGCC-NOT: warning: +-// CHECK-LD-64-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-LD-64-STATIC-LIBGCC: "--eh-frame-hdr" +-// CHECK-LD-64-STATIC-LIBGCC: "-m" "elf_x86_64" +-// CHECK-LD-64-STATIC-LIBGCC: "-dynamic-linker" +-// CHECK-LD-64-STATIC-LIBGCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o" +-// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" +-// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" +-// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." +-// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/lib" +-// CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib" +-// CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" +-// CHECK-LD-64-STATIC-LIBGCC: "-lc" +-// CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target x86_64-unknown-linux \ +-// RUN: -static \ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s +-// CHECK-LD-64-STATIC-NOT: warning: +-// CHECK-LD-64-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-LD-64-STATIC-NOT: "--eh-frame-hdr" +-// CHECK-LD-64-STATIC: "-m" "elf_x86_64" +-// CHECK-LD-64-STATIC-NOT: "-dynamic-linker" +-// CHECK-LD-64-STATIC: "-static" +-// CHECK-LD-64-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbeginT.o" +-// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" +-// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" +-// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." +-// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/lib" +-// CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib" +-// CHECK-LD-64-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group" +-// +-// Check that flags can be combined. The -static dominates. +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target x86_64-unknown-linux \ +-// RUN: -static-libgcc -static \ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// 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:[^"]+]]" +-// CHECK-32-TO-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/crtbegin.o" +-// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" +-// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib32" +-// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib32" +-// CHECK-32-TO-32: "-L[[SYSROOT]]/lib/../lib32" +-// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32" +-// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" +-// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." +-// CHECK-32-TO-32: "-L[[SYSROOT]]/lib" +-// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// 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:[^"]+]]" +-// CHECK-32-TO-64: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/64/crtbegin.o" +-// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/64" +-// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib64" +-// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib64" +-// CHECK-32-TO-64: "-L[[SYSROOT]]/lib/../lib64" +-// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64" +-// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" +-// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" +-// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." +-// CHECK-32-TO-64: "-L[[SYSROOT]]/lib" +-// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// 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:[^"]+]]" +-// CHECK-64-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o" +-// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" +-// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib64" +-// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib64" +-// CHECK-64-TO-64: "-L[[SYSROOT]]/lib/../lib64" +-// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64" +-// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" +-// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." +-// CHECK-64-TO-64: "-L[[SYSROOT]]/lib" +-// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// 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:[^"]+]]" +-// CHECK-64-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32/crtbegin.o" +-// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32" +-// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib32" +-// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib32" +-// CHECK-64-TO-32: "-L[[SYSROOT]]/lib/../lib32" +-// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32" +-// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" +-// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" +-// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." +-// CHECK-64-TO-32: "-L[[SYSROOT]]/lib" +-// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// 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 +-// CHECK-INSTALL-DIR-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-INSTALL-DIR-32: "{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0/crtbegin.o" +-// CHECK-INSTALL-DIR-32: "-L{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0" +-// +-// 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: -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 +-// CHECK-INSTALL-DIR-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-INSTALL-DIR-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o" +-// CHECK-INSTALL-DIR-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" +-// +-// Check that we support unusual patch version formats, including missing that +-// component. +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// 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 +-// CHECK-GCC-VERSION1: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// 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: -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 +-// CHECK-GCC-VERSION2: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// 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: -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 +-// 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: -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" +-// +-// Check multi arch support on Ubuntu 12.04 LTS. +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-unknown-linux-gnueabihf \ +-// RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM-HF %s +-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf/crt1.o" +-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf/crti.o" +-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/crtbegin.o" +-// CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3" +-// CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf" +-// CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/lib/arm-linux-gnueabihf" +-// CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabihf" +-// CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../.." +-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/crtend.o" +-// CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf/crtn.o" +-// +-// Check fedora 18 on arm. +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target armv7-unknown-linux-gnueabihf \ +-// RUN: --sysroot=%S/Inputs/fedora_18_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-FEDORA-18-ARM-HF %s +-// CHECK-FEDORA-18-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../crt1.o" +-// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../crti.o" +-// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/crtbegin.o" +-// CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2" +-// CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../.." +-// CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/lib" +-// CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib" +-// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/crtend.o" +-// CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../crtn.o" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-unknown-linux-gnueabi \ +-// RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM %s +-// CHECK-UBUNTU-12-04-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi/crt1.o" +-// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi/crti.o" +-// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/crtbegin.o" +-// CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1" +-// CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi" +-// CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/lib/arm-linux-gnueabi" +-// CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabi" +-// CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../.." +-// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/crtend.o" +-// CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi/crtn.o" +-// +-// 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 dynamic-linker for different archs +-// RUN: %clang %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-linux-gnueabi \ +-// RUN: | FileCheck --check-prefix=CHECK-ARM %s +-// CHECK-ARM: "{{.*}}ld{{(.exe)?}}" +-// CHECK-ARM: "-m" "armelf_linux_eabi" +-// CHECK-ARM: "-dynamic-linker" "{{.*}}/lib/ld-linux.so.3" +-// +-// RUN: %clang %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-linux-gnueabihf \ +-// RUN: | FileCheck --check-prefix=CHECK-ARM-HF %s +-// CHECK-ARM-HF: "{{.*}}ld{{(.exe)?}}" +-// CHECK-ARM-HF: "-m" "armelf_linux_eabi" +-// CHECK-ARM-HF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3" +-// +-// 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 \ +-// 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 \ +-// 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 \ +-// 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 \ +-// 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}}" +-// RUN: %clang %s -### -o %t.o 2>&1 \ +-// RUN: -target mips64-linux-gnu -mabi=n32 \ +-// RUN: | FileCheck --check-prefix=CHECK-MIPS64-N32 %s +-// CHECK-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" +-// CHECK-MIPS64-N32: "-m" "elf32btsmipn32" +-// CHECK-MIPS64-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1" +-// CHECK-MIPS64-N32-NOT: "--hash-style={{gnu|both}}" +-// RUN: %clang %s -### -o %t.o 2>&1 \ +-// RUN: -target mips64el-linux-gnu -mabi=n32 \ +-// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-N32 %s +-// CHECK-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" +-// CHECK-MIPS64EL-N32: "-m" "elf32ltsmipn32" +-// CHECK-MIPS64EL-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1" +-// CHECK-MIPS64EL-N32-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" +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mips-linux-gnu \ +-// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS %s +-// CHECK-DEBIAN-MIPS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-DEBIAN-MIPS: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/crtbegin.o" +-// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5" +-// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../../mips-linux-gnu" +-// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/mips-linux-gnu" +-// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.." +-// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/lib" +-// CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib" +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mipsel-linux-gnu \ +-// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPSEL %s +-// CHECK-DEBIAN-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-DEBIAN-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/crtbegin.o" +-// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5" +-// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../../mipsel-linux-gnu" +-// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/mipsel-linux-gnu" +-// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.." +-// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/lib" +-// CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib" +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mips64-linux-gnu \ +-// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64 %s +-// CHECK-DEBIAN-MIPS64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-DEBIAN-MIPS64: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/64/crtbegin.o" +-// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/64" +-// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5" +-// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.." +-// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/lib" +-// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib" +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mips64el-linux-gnu \ +-// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL %s +-// CHECK-DEBIAN-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-DEBIAN-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/64/crtbegin.o" +-// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/64" +-// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5" +-// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.." +-// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/lib" +-// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib" +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mips64-linux-gnu -mabi=n32 \ +-// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64-N32 %s +-// CHECK-DEBIAN-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-DEBIAN-MIPS64-N32: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/n32/crtbegin.o" +-// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/n32" +-// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5" +-// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.." +-// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/lib" +-// CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib" +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mips64el-linux-gnu -mabi=n32 \ +-// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL-N32 %s +-// CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/n32/crtbegin.o" +-// CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/n32" +-// CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5" +-// CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.." +-// CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/lib" +-// CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib" +-// +-// Test linker invocation on Android. +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-linux-androideabi \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mipsel-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target i386-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s +-// CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-ANDROID: "{{.*}}/crtbegin_dynamic.o" +-// CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib" +-// CHECK-ANDROID-NOT: "gcc_s" +-// CHECK-ANDROID: "-lgcc" +-// CHECK-ANDROID: "-ldl" +-// CHECK-ANDROID-NOT: "gcc_s" +-// CHECK-ANDROID: "{{.*}}/crtend_android.o" +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-linux-androideabi \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -shared \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -shared \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mipsel-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -shared \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target i386-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -shared \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s +-// CHECK-ANDROID-SO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-ANDROID-SO: "-Bsymbolic" +-// CHECK-ANDROID-SO: "{{.*}}/crtbegin_so.o" +-// CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib" +-// CHECK-ANDROID-SO-NOT: "gcc_s" +-// CHECK-ANDROID-SO: "-lgcc" +-// CHECK-ANDROID-SO: "-ldl" +-// CHECK-ANDROID-SO-NOT: "gcc_s" +-// CHECK-ANDROID-SO: "{{.*}}/crtend_so.o" +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-linux-androideabi \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -static \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -static \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mipsel-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -static \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target i386-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -static \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s +-// CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-ANDROID-STATIC: "{{.*}}/crtbegin_static.o" +-// CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib" +-// CHECK-ANDROID-STATIC-NOT: "gcc_s" +-// CHECK-ANDROID-STATIC: "-lgcc" +-// CHECK-ANDROID-STATIC-NOT: "-ldl" +-// CHECK-ANDROID-STATIC-NOT: "gcc_s" +-// CHECK-ANDROID-STATIC: "{{.*}}/crtend_android.o" +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-linux-androideabi \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -pie \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target arm-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -pie \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mipsel-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -pie \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target i386-linux-android \ +-// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +-// RUN: -pie \ +-// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s +-// CHECK-ANDROID-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-ANDROID-PIE: "{{.*}}/crtbegin_dynamic.o" +-// CHECK-ANDROID-PIE: "-L[[SYSROOT]]/usr/lib" +-// CHECK-ANDROID-PIE-NOT: "gcc_s" +-// CHECK-ANDROID-PIE: "-lgcc" +-// CHECK-ANDROID-PIE-NOT: "gcc_s" +-// CHECK-ANDROID-PIE: "{{.*}}/crtend_android.o" +-// +-// Check linker invocation on Debian 6 MIPS 32/64-bit. +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mipsel-linux-gnu \ +-// RUN: --sysroot=%S/Inputs/debian_6_mips_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPSEL %s +-// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib/crt1.o" +-// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib/crti.o" +-// CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/crtbegin.o" +-// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4" +-// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib" +-// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib/../lib" +-// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/../lib" +-// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.." +-// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib" +-// CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mips64el-linux-gnu \ +-// RUN: --sysroot=%S/Inputs/debian_6_mips_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL %s +-// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64/crt1.o" +-// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64/crti.o" +-// CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/64/crtbegin.o" +-// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/64" +-// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64" +-// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib/../lib64" +-// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/../lib64" +-// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.." +-// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib" +-// CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib" +-// +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target mips64el-linux-gnu -mabi=n32 \ +-// RUN: --sysroot=%S/Inputs/debian_6_mips_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-N32 %s +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32/crt1.o" +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32/crti.o" +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/n32/crtbegin.o" +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/n32" +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32" +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib/../lib32" +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/../lib32" +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.." +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib" +-// CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib" +-// +-// Test linker invocation for Freescale SDK (OpenEmbedded). +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target powerpc-fsl-linux \ +-// RUN: --sysroot=%S/Inputs/freescale_ppc_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-FSL-PPC %s +-// CHECK-FSL-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-FSL-PPC: "-m" "elf32ppclinux" +-// CHECK-FSL-PPC: "{{.*}}/crt1.o" +-// CHECK-FSL-PPC: "{{.*}}/crtbegin.o" +-// CHECK-FSL-PPC: "-L[[SYSROOT]]/usr/lib" +-// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: -target powerpc64-fsl-linux \ +-// RUN: --sysroot=%S/Inputs/freescale_ppc64_tree \ +-// RUN: | FileCheck --check-prefix=CHECK-FSL-PPC64 %s +-// CHECK-FSL-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +-// CHECK-FSL-PPC64: "-m" "elf64ppc" +-// CHECK-FSL-PPC64: "{{.*}}/crt1.o" +-// CHECK-FSL-PPC64: "{{.*}}/crtbegin.o" +-// CHECK-FSL-PPC64: "-L[[SYSROOT]]/usr/lib64/powerpc64-fsl-linux/4.6.2/../.." +-// +-// Check that crtfastmath.o is linked with -ffast-math. +-// RUN: %clang -target x86_64-unknown-linux -### %s \ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ +-// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s +-// RUN: %clang -target x86_64-unknown-linux -### %s -ffast-math \ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ +-// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s +-// RUN: %clang -target x86_64-unknown-linux -### %s -funsafe-math-optimizations\ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ +-// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s +-// RUN: %clang -target x86_64-unknown-linux -### %s -ffast-math -fno-fast-math \ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ +-// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s +-// We don't have crtfastmath.o in the i386 tree, use it to check that file +-// detection works. +-// RUN: %clang -target i386-unknown-linux -### %s -ffast-math \ +-// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ +-// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s +-// CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtfastmath.o +-// CHECK-NOCRTFASTMATH-NOT: crtfastmath.o diff --git a/easybuild/easyconfigs/n/ncurses/ncurses-5.9-GCC-4.8.1.eb b/easybuild/easyconfigs/n/ncurses/ncurses-5.9-GCC-4.8.1.eb new file mode 100644 index 000000000000..910be3e3246a --- /dev/null +++ b/easybuild/easyconfigs/n/ncurses/ncurses-5.9-GCC-4.8.1.eb @@ -0,0 +1,15 @@ +name = 'ncurses' +version = '5.9' + +homepage = 'http://www.gnu.org/software/ncurses/' +description = """The Ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, +and more. It uses Terminfo format, supports pads and color and multiple highlights and forms characters and +function-key mapping, and has all the other SYSV-curses enhancements over BSD Curses.""" + +toolchain = {'name': 'GCC', 'version': '4.8.1'} +toolchainopts = {'optarch': True, 'pic': True} + +source_urls = ['http://ftpmirror.gnu.org/%(name)s'] +sources = [SOURCE_TAR_GZ] + +moduleclass = 'devel'