From: Louis Dionne Date: Fri, 5 Aug 2022 17:49:39 +0000 (-0400) Subject: [clang][Darwin] Re-apply "Always set the default C++ Standard Library to libc++" X-Git-Tag: upstream/17.0.6~36362 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=65d83ba34378b8e740c5203fe46a9c50d2aeb862;p=platform%2Fupstream%2Fllvm.git [clang][Darwin] Re-apply "Always set the default C++ Standard Library to libc++" Newer SDKs don't even provide libstdc++ headers, so it's effectively never valid to build for libstdc++ unless the user explicitly asks for it (in which case they will need to provide include paths and more). This is a re-application of c5ccb78ade81 which had been reverted in 33171df9cc7f because it broke the Fuchsia CI bots. The issue was that the test was XPASSing because it didn't fail anymore when the CLANG_DEFAULT_CXX_LIB was set to libc++, which seems to be done for Fuchsia. Instead, the test only fails if CLANG_DEFAULT_CXX_LIB is set to libstdc++. As a fly-by fix, also adjust the triple used by various tests to something that is supported. Those tests were shown to fail on internal bots. Differential Revision: https://reviews.llvm.org/D131274 --- diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp index bada811..7e3fc62 100644 --- a/clang/lib/Driver/ToolChains/Darwin.cpp +++ b/clang/lib/Driver/ToolChains/Darwin.cpp @@ -896,12 +896,7 @@ types::ID MachO::LookupTypeForExtension(StringRef Ext) const { bool MachO::HasNativeLLVMSupport() const { return true; } ToolChain::CXXStdlibType Darwin::GetDefaultCXXStdlibType() const { - // Use libstdc++ on old targets (OSX < 10.9 and iOS < 7) - if ((isTargetMacOSBased() && isMacosxVersionLT(10, 9)) || - (isTargetIOSBased() && isIPhoneOSVersionLT(7, 0))) - return ToolChain::CST_Libstdcxx; - - // On all other targets, use libc++ + // Always use libc++ by default return ToolChain::CST_Libcxx; } diff --git a/clang/test/Driver/Xarch.c b/clang/test/Driver/Xarch.c index ae0816f..f7693fb 100644 --- a/clang/test/Driver/Xarch.c +++ b/clang/test/Driver/Xarch.c @@ -1,12 +1,12 @@ -// RUN: %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -O3 %s -S -### 2>&1 | FileCheck -check-prefix=O3ONCE %s +// RUN: %clang -target i386-apple-darwin11 -m32 -Xarch_i386 -O3 %s -S -### 2>&1 | FileCheck -check-prefix=O3ONCE %s // O3ONCE: "-O3" // O3ONCE-NOT: "-O3" -// RUN: %clang -target i386-apple-darwin9 -m64 -Xarch_i386 -O3 %s -S -### 2>&1 | FileCheck -check-prefix=O3NONE %s +// RUN: %clang -target i386-apple-darwin11 -m64 -Xarch_i386 -O3 %s -S -### 2>&1 | FileCheck -check-prefix=O3NONE %s // O3NONE-NOT: "-O3" // O3NONE: argument unused during compilation: '-Xarch_i386 -O3' -// RUN: not %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2>&1 | FileCheck -check-prefix=INVALID %s +// RUN: not %clang -target i386-apple-darwin11 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2>&1 | FileCheck -check-prefix=INVALID %s // INVALID: error: invalid Xarch argument: '-Xarch_i386 -o' // INVALID: error: invalid Xarch argument: '-Xarch_i386 -S' // INVALID: error: invalid Xarch argument: '-Xarch_i386 -o' diff --git a/clang/test/Driver/apple-kext-mkernel.c b/clang/test/Driver/apple-kext-mkernel.c index f056ec8..ac476e9 100644 --- a/clang/test/Driver/apple-kext-mkernel.c +++ b/clang/test/Driver/apple-kext-mkernel.c @@ -1,20 +1,20 @@ -// RUN: %clang -target x86_64-apple-darwin10 -mkernel -### -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK-X86 %s -// RUN: %clang -target x86_64-apple-darwin10 -mkernel -### -fsyntax-only -fbuiltin -fno-builtin -fcommon -fno-common %s 2>&1 | FileCheck --check-prefix=CHECK-X86 %s +// RUN: %clang -target x86_64-apple-darwin11 -mkernel -### -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK-X86 %s +// RUN: %clang -target x86_64-apple-darwin11 -mkernel -### -fsyntax-only -fbuiltin -fno-builtin -fcommon -fno-common %s 2>&1 | FileCheck --check-prefix=CHECK-X86 %s // CHECK-X86: "-disable-red-zone" // CHECK-X86: "-fno-builtin" // CHECK-X86: "-fno-rtti" // CHECK-X86-NOT: "-fcommon" -// RUN: %clang -target x86_64-apple-darwin10 -mkernel -### -fsyntax-only -fbuiltin -fcommon %s 2>&1 | FileCheck --check-prefix=CHECK-X86-2 %s +// RUN: %clang -target x86_64-apple-darwin11 -mkernel -### -fsyntax-only -fbuiltin -fcommon %s 2>&1 | FileCheck --check-prefix=CHECK-X86-2 %s // CHECK-X86-2: "-disable-red-zone" // CHECK-X86-2-NOT: "-fno-builtin" // CHECK-X86-2: "-fno-rtti" // CHECK-X86-2-NOT: "-fno-common" -// RUN: %clang -target x86_64-apple-darwin10 -arch armv7 -mkernel -mstrict-align -### -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK-ARM %s -// RUN: %clang -target x86_64-apple-darwin10 -arch armv7 -mkernel -mstrict-align -### -fsyntax-only -fbuiltin -fno-builtin -fcommon -fno-common %s 2>&1 | FileCheck --check-prefix=CHECK-ARM %s +// RUN: %clang -target x86_64-apple-darwin11 -arch armv7 -mkernel -mstrict-align -### -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK-ARM %s +// RUN: %clang -target x86_64-apple-darwin11 -arch armv7 -mkernel -mstrict-align -### -fsyntax-only -fbuiltin -fno-builtin -fcommon -fno-common %s 2>&1 | FileCheck --check-prefix=CHECK-ARM %s // CHECK-ARM: "-target-feature" "+long-calls" // CHECK-ARM: "-target-feature" "+strict-align" @@ -23,6 +23,6 @@ // CHECK-ARM: "-fno-rtti" // CHECK-ARM-NOT: "-fcommon" -// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: %clang -target x86_64-apple-darwin11 \ // RUN: -Werror -fno-builtin -fno-exceptions -fno-common -fno-rtti \ // RUN: -mkernel -fsyntax-only %s diff --git a/clang/test/Driver/arc.c b/clang/test/Driver/arc.c index 0025297..6c91a3b 100644 --- a/clang/test/Driver/arc.c +++ b/clang/test/Driver/arc.c @@ -1,8 +1,8 @@ -// RUN: not %clang -ObjC -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s -// RUN: not %clang -x objective-c -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s -// RUN: not %clang -x objective-c++ -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s -// RUN: not %clang -x c -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s -// RUN: not %clang -x c++ -target i386-apple-darwin10 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s +// RUN: not %clang -ObjC -target i386-apple-darwin10 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s +// RUN: not %clang -x objective-c -target i386-apple-darwin10 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s +// RUN: not %clang -x objective-c++ -target i386-apple-darwin10 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s +// RUN: not %clang -x c -target i386-apple-darwin10 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s +// RUN: not %clang -x c++ -target i386-apple-darwin10 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s // RUN: not %clang -x objective-c -target x86_64-apple-darwin11 -mmacosx-version-min=10.5 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTSUPPORTED %s // Just to test clang is working. diff --git a/clang/test/Driver/bindings.c b/clang/test/Driver/bindings.c index 93164f4..cad5cb9 100644 --- a/clang/test/Driver/bindings.c +++ b/clang/test/Driver/bindings.c @@ -12,14 +12,14 @@ // RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -fsyntax-only -x c++ %s 2>&1 | FileCheck %s --check-prefix=CHECK08 // CHECK08: "clang", inputs: ["{{.*}}bindings.c"], output: (nothing) -// RUN: %clang -target i386-apple-darwin9 -ccc-print-bindings %s -S -arch ppc 2>&1 | FileCheck %s --check-prefix=CHECK11 +// RUN: %clang -target i386-apple-darwin11 -ccc-print-bindings %s -S -arch ppc 2>&1 | FileCheck %s --check-prefix=CHECK11 // CHECK11: "clang", inputs: ["{{.*}}bindings.c"], output: "bindings.s" // RUN: %clang -target powerpc-unknown-unknown -ccc-print-bindings %s -S 2>&1 | FileCheck %s --check-prefix=CHECK12 // CHECK12: "clang", inputs: ["{{.*}}bindings.c"], output: "bindings.s" // Darwin bindings -// RUN: %clang -target i386-apple-darwin9 -no-integrated-as -ccc-print-bindings %s 2>&1 | FileCheck %s --check-prefix=CHECK14 +// RUN: %clang -target i386-apple-darwin11 -no-integrated-as -ccc-print-bindings %s 2>&1 | FileCheck %s --check-prefix=CHECK14 // CHECK14: "clang", inputs: ["{{.*}}bindings.c"], output: "{{.*}}.s" // CHECK14: "darwin::Assembler", inputs: ["{{.*}}.s"], output: "{{.*}}.o" // CHECK14: "darwin::Linker", inputs: ["{{.*}}.o"], output: "a.out" @@ -29,5 +29,5 @@ // CHECK15: "x86_64-unknown-linux-gnu" - "GNU::StaticLibTool", inputs: ["{{.*}}.o"], output: "a.out" // Darwin StaticLibTool binding -// RUN: %clang -target i386-apple-darwin9 -ccc-print-bindings --emit-static-lib %s 2>&1 | FileCheck %s --check-prefix=CHECK16 -// CHECK16: "i386-apple-darwin9" - "darwin::StaticLibTool", inputs: ["{{.*}}.o"], output: "a.out" +// RUN: %clang -target i386-apple-darwin11 -ccc-print-bindings --emit-static-lib %s 2>&1 | FileCheck %s --check-prefix=CHECK16 +// CHECK16: "i386-apple-darwin11" - "darwin::StaticLibTool", inputs: ["{{.*}}.o"], output: "a.out" diff --git a/clang/test/Driver/cc-log-diagnostics.c b/clang/test/Driver/cc-log-diagnostics.c index 22d3389..1e21c6a7 100644 --- a/clang/test/Driver/cc-log-diagnostics.c +++ b/clang/test/Driver/cc-log-diagnostics.c @@ -1,7 +1,7 @@ // RUN: rm -f %t.log // RUN: env RC_DEBUG_OPTIONS=1 \ // RUN: CC_LOG_DIAGNOSTICS=1 CC_LOG_DIAGNOSTICS_FILE=%t.log \ -// RUN: %clang -Wfoobar --target=x86_64-apple-darwin10 -fsyntax-only %s +// RUN: %clang -Wfoobar --target=x86_64-apple-darwin11 -fsyntax-only %s // RUN: FileCheck %s < %t.log int f0(void) {} diff --git a/clang/test/Driver/cpp-precomp.c b/clang/test/Driver/cpp-precomp.c index a384a35..a3fd94d 100644 --- a/clang/test/Driver/cpp-precomp.c +++ b/clang/test/Driver/cpp-precomp.c @@ -1,5 +1,5 @@ -// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: %clang -target x86_64-apple-darwin11 \ // RUN: -Werror -cpp-precomp -fsyntax-only %s -// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: %clang -target x86_64-apple-darwin11 \ // RUN: -Werror -no-cpp-precomp -fsyntax-only %s diff --git a/clang/test/Driver/darwin-debug-flags.c b/clang/test/Driver/darwin-debug-flags.c index 7b76f97..23925e6 100644 --- a/clang/test/Driver/darwin-debug-flags.c +++ b/clang/test/Driver/darwin-debug-flags.c @@ -1,15 +1,15 @@ -// RUN: env RC_DEBUG_OPTIONS=1 %clang -target i386-apple-darwin9 -I "path with \spaces" -g -Os %s -emit-llvm -S -o - | FileCheck %s +// RUN: env RC_DEBUG_OPTIONS=1 %clang -target i386-apple-darwin11 -I "path with \spaces" -g -Os %s -emit-llvm -S -o - | FileCheck %s // // RUN: touch %t.s -// RUN: env RC_DEBUG_OPTIONS=1 %clang -### -target i386-apple-darwin9 -c -g %t.s 2>&1 | FileCheck -check-prefix=S %s +// RUN: env RC_DEBUG_OPTIONS=1 %clang -### -target i386-apple-darwin11 -c -g %t.s 2>&1 | FileCheck -check-prefix=S %s // -// RUN: %clang -### -target i386-apple-darwin9 -c -g %t.s 2>&1 | FileCheck -check-prefix=P %s +// RUN: %clang -### -target i386-apple-darwin11 -c -g %t.s 2>&1 | FileCheck -check-prefix=P %s // CHECK: distinct !DICompileUnit( // CHECK-SAME: flags: // CHECK-SAME: -I path\\ with\\ \\\\spaces // CHECK-SAME: -g -Os -// CHECK-SAME: -mmacos-version-min=10.5.0 +// CHECK-SAME: -mmacos-version-min=10.7.0 int x; diff --git a/clang/test/Driver/darwin-dsymutil.c b/clang/test/Driver/darwin-dsymutil.c index 7a6e494..5300c78 100644 --- a/clang/test/Driver/darwin-dsymutil.c +++ b/clang/test/Driver/darwin-dsymutil.c @@ -1,6 +1,6 @@ // Check that we run dsymutil properly with multiple -arch options. // -// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \ +// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-phases \ // RUN: -arch i386 -arch x86_64 %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s // @@ -15,57 +15,57 @@ // CHECK-MULTIARCH-ACTIONS: 8: lipo, {6, 7}, image // CHECK-MULTIARCH-ACTIONS: 9: dsymutil, {8}, dSYM // -// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \ // RUN: -arch i386 -arch x86_64 %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s // -// CHECK-MULTIARCH-BINDINGS: "x86_64-apple-darwin10" - "darwin::Lipo", inputs: [{{.*}}, {{.*}}], output: "a.out" -// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["a.out"], output: "a.out.dSYM" +// CHECK-MULTIARCH-BINDINGS: "x86_64-apple-darwin11" - "darwin::Lipo", inputs: [{{.*}}, {{.*}}], output: "a.out" +// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin11" - "darwin::Dsymutil", inputs: ["a.out"], output: "a.out.dSYM" // Check output name derivation. // -// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \ // RUN: -o foo %s -g 2> %t // RUN: FileCheck -Doutfile=foo -Ddsymfile=foo.dSYM \ // RUN: -check-prefix=CHECK-OUTPUT-NAME < %t %s // -// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \ // RUN: -o bar/foo %s -g 2> %t // RUN: FileCheck -Doutfile=bar/foo -Ddsymfile=bar/foo.dSYM \ // RUN: -check-prefix=CHECK-OUTPUT-NAME < %t %s // -// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \ // RUN: -o bar/foo -dsym-dir external %s -g 2> %t // RUN: FileCheck -Doutfile=bar/foo -Ddsymfile=external/foo.dSYM \ // RUN: -check-prefix=CHECK-OUTPUT-NAME < %t %s // -// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Linker", inputs: [{{.*}}], output: "[[outfile]]" -// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["[[outfile]]"], output: "[[dsymfile]]" +// CHECK-OUTPUT-NAME: "x86_64-apple-darwin11" - "darwin::Linker", inputs: [{{.*}}], output: "[[outfile]]" +// CHECK-OUTPUT-NAME: "x86_64-apple-darwin11" - "darwin::Dsymutil", inputs: ["[[outfile]]"], output: "[[dsymfile]]" // Check output name derivation for multiple -arch options. // -// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: %clang -target x86_64-apple-darwin11 \ // RUN: -arch x86_64 -arch arm64 -ccc-print-bindings %s 2> %t // RUN: FileCheck --check-prefix=CHECK-MULTIARCH-OUTPUT-NAME < %t %s // -// CHECK-MULTIARCH-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Linker", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out" -// CHECK-MULTIARCH-OUTPUT-NAME: "arm64-apple-darwin10" - "darwin::Linker", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-arm64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out" -// CHECK-MULTIARCH-OUTPUT-NAME: "arm64-apple-darwin10" - "darwin::Lipo", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out", "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out"], output: "a.out" +// CHECK-MULTIARCH-OUTPUT-NAME: "x86_64-apple-darwin11" - "darwin::Linker", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out" +// CHECK-MULTIARCH-OUTPUT-NAME: "arm64-apple-darwin11" - "darwin::Linker", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-arm64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out" +// CHECK-MULTIARCH-OUTPUT-NAME: "arm64-apple-darwin11" - "darwin::Lipo", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out", "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out"], output: "a.out" // -// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: %clang -target x86_64-apple-darwin11 \ // RUN: -Wl,-foo -arch x86_64 -arch arm64 -ccc-print-bindings %s 2> %t // RUN: FileCheck --check-prefix=CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG < %t %s // -// CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG: "x86_64-apple-darwin10" - "darwin::Linker", inputs: [(input arg), "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out" -// CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG: "arm64-apple-darwin10" - "darwin::Linker", inputs: [(input arg), "{{.*}}{{/|\\}}darwin-dsymutil-arm64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out" -// CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG: "arm64-apple-darwin10" - "darwin::Lipo", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out", "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out"], output: "a.out" +// CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG: "x86_64-apple-darwin11" - "darwin::Linker", inputs: [(input arg), "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out" +// CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG: "arm64-apple-darwin11" - "darwin::Linker", inputs: [(input arg), "{{.*}}{{/|\\}}darwin-dsymutil-arm64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out" +// CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG: "arm64-apple-darwin11" - "darwin::Lipo", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out", "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out"], output: "a.out" // Check that we only use dsymutil when needed. // // RUN: touch %t.o -// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \ // RUN: -o foo %t.o -g 2> %t // RUN: not grep "Dsymutil" %t // Check that we don't crash when translating arguments for dsymutil. -// RUN: %clang -m32 -target x86_64-apple-darwin10 -arch x86_64 -g %s -### +// RUN: %clang -m32 -target x86_64-apple-darwin11 -arch x86_64 -g %s -### diff --git a/clang/test/Driver/darwin-iphone-defaults.m b/clang/test/Driver/darwin-iphone-defaults.m index ec9507f..79d3bc8 100644 --- a/clang/test/Driver/darwin-iphone-defaults.m +++ b/clang/test/Driver/darwin-iphone-defaults.m @@ -1,4 +1,4 @@ -// RUN: %clang -target i386-apple-darwin9 -miphoneos-version-min=3.0 -arch armv7 -stdlib=platform -flto -S -o - %s | FileCheck %s +// RUN: %clang -target i386-apple-darwin -miphoneos-version-min=5.0 -arch armv7 -stdlib=platform -flto -S -o - %s | FileCheck %s // CHECK: @f0() [[F0:#[0-9]+]] // CHECK: @__f0_block_invoke diff --git a/clang/test/Driver/darwin-stdlib.cpp b/clang/test/Driver/darwin-stdlib.cpp index 0538a42..fdfdfaf 100644 --- a/clang/test/Driver/darwin-stdlib.cpp +++ b/clang/test/Driver/darwin-stdlib.cpp @@ -1,14 +1,10 @@ -// This test will fail if CLANG_DEFAULT_CXX_STDLIB is set to anything different -// than the platform default. (see https://llvm.org/bugs/show_bug.cgi?id=30548) -// XFAIL: default-cxx-stdlib-set +// This test will fail if CLANG_DEFAULT_CXX_STDLIB is set to libstdc++. +// XFAIL: default-cxx-stdlib=libstdc++ -// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch arm64 -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX -// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.8 -Wno-stdlibcxx-not-found %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBSTDCXX -// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.9 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX -// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=6.1 -Wno-stdlibcxx-not-found %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBSTDCXX -// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX -// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7k %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch arm64 -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.9 %s -### 2>&1 | FileCheck %s +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s +// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7k %s -### 2>&1 | FileCheck %s -// CHECK-LIBCXX: "-stdlib=libc++" -// CHECK-LIBSTDCXX-NOT: -stdlib=libc++ -// CHECK-LIBSTDCXX-NOT: -stdlib=libstdc++ +// CHECK: "-stdlib=libc++" +// CHECK-NOT: "-stdlib=libstdc++" diff --git a/clang/test/Driver/darwin-verify-debug.c b/clang/test/Driver/darwin-verify-debug.c index 6b91290..65624c70 100644 --- a/clang/test/Driver/darwin-verify-debug.c +++ b/clang/test/Driver/darwin-verify-debug.c @@ -1,6 +1,6 @@ // Check that we verify debug output properly with multiple -arch options. // -// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \ +// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-phases \ // RUN: --verify-debug-info -arch i386 -arch x86_64 %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s // @@ -8,26 +8,26 @@ // CHECK-MULTIARCH-ACTIONS: 9: dsymutil, {8}, dSYM // CHECK-MULTIARCH-ACTIONS: 10: verify-debug-info, {9}, none // -// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \ // RUN: --verify-debug-info -arch i386 -arch x86_64 %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s // -// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["a.out"], output: "a.out.dSYM" -// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin10" - "darwin::VerifyDebug", inputs: ["a.out.dSYM"], output: (nothing) +// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin11" - "darwin::Dsymutil", inputs: ["a.out"], output: "a.out.dSYM" +// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin11" - "darwin::VerifyDebug", inputs: ["a.out.dSYM"], output: (nothing) // Check output name derivation. // -// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \ // RUN: --verify-debug-info -o foo %s -g 2> %t // RUN: FileCheck -check-prefix=CHECK-OUTPUT-NAME < %t %s // -// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Linker", inputs: [{{.*}}], output: "foo" -// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["foo"], output: "foo.dSYM" -// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::VerifyDebug", inputs: ["foo.dSYM"], output: (nothing) +// CHECK-OUTPUT-NAME: "x86_64-apple-darwin11" - "darwin::Linker", inputs: [{{.*}}], output: "foo" +// CHECK-OUTPUT-NAME: "x86_64-apple-darwin11" - "darwin::Dsymutil", inputs: ["foo"], output: "foo.dSYM" +// CHECK-OUTPUT-NAME: "x86_64-apple-darwin11" - "darwin::VerifyDebug", inputs: ["foo.dSYM"], output: (nothing) // Check that we only verify when needed. // // RUN: touch %t.o -// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \ +// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \ // RUN: --verify-debug-info -o foo %t.o -g 2> %t // RUN: not grep "Verify" %t diff --git a/clang/test/Driver/diagnostics.c b/clang/test/Driver/diagnostics.c index b9455b0..954a6d9 100644 --- a/clang/test/Driver/diagnostics.c +++ b/clang/test/Driver/diagnostics.c @@ -6,37 +6,37 @@ // diagnostics when only compiling for all targets. // This is normally a non-fatal warning: -// RUN: %clang --target=x86_64-apple-darwin10 \ +// RUN: %clang --target=x86_64-apple-darwin11 \ // RUN: -fsyntax-only -lfoo %s 2>&1 | FileCheck %s // Either with a specific -Werror=unused.. or a blanket -Werror, this // causes the command to fail. -// RUN: not %clang --target=x86_64-apple-darwin10 \ +// RUN: not %clang --target=x86_64-apple-darwin11 \ // RUN: -fsyntax-only -lfoo \ // RUN: -Werror=unused-command-line-argument %s 2>&1 | FileCheck %s -// RUN: not %clang --target=x86_64-apple-darwin10 \ +// RUN: not %clang --target=x86_64-apple-darwin11 \ // RUN: -fsyntax-only -lfoo -Werror %s 2>&1 | FileCheck %s // With a specific -Wno-..., no diagnostic should be printed. -// RUN: %clang --target=x86_64-apple-darwin10 \ +// RUN: %clang --target=x86_64-apple-darwin11 \ // RUN: -fsyntax-only -lfoo -Werror \ // RUN: -Wno-unused-command-line-argument %s 2>&1 | count 0 // With -Qunused-arguments, no diagnostic should be printed. -// RUN: %clang --target=x86_64-apple-darwin10 \ +// RUN: %clang --target=x86_64-apple-darwin11 \ // RUN: -fsyntax-only -lfoo -Werror \ // RUN: -Qunused-arguments %s 2>&1 | count 0 // With the argument enclosed in --{start,end}-no-unused-arguments, // there's no diagnostic. -// RUN: %clang --target=x86_64-apple-darwin10 -fsyntax-only \ +// RUN: %clang --target=x86_64-apple-darwin11 -fsyntax-only \ // RUN: --start-no-unused-arguments -lfoo --end-no-unused-arguments \ // RUN: -Werror %s 2>&1 | count 0 // With --{start,end}-no-unused-argument around a different argument, it // still warns about the unused argument. -// RUN: not %clang --target=x86_64-apple-darwin10 \ +// RUN: not %clang --target=x86_64-apple-darwin11 \ // RUN: --start-no-unused-arguments -fsyntax-only --end-no-unused-arguments \ // RUN: -lfoo -Werror %s 2>&1 | FileCheck %s diff --git a/clang/test/Driver/exceptions.m b/clang/test/Driver/exceptions.m index 51f1dd2..90c9bb5 100644 --- a/clang/test/Driver/exceptions.m +++ b/clang/test/Driver/exceptions.m @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-apple-darwin9 \ +// RUN: %clang -target x86_64-apple-darwin11 \ // RUN: -fsyntax-only -fno-exceptions %s void f1(void) { diff --git a/clang/test/Driver/redundant-args.c b/clang/test/Driver/redundant-args.c index 7bf98e1..7d00699 100644 --- a/clang/test/Driver/redundant-args.c +++ b/clang/test/Driver/redundant-args.c @@ -1,2 +1,2 @@ -// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: %clang -target x86_64-apple-darwin11 \ // RUN: -Werror -x c -x c -fsyntax-only %s diff --git a/clang/test/Headers/float-darwin.c b/clang/test/Headers/float-darwin.c index 54bac1a..54550f0 100644 --- a/clang/test/Headers/float-darwin.c +++ b/clang/test/Headers/float-darwin.c @@ -1,5 +1,5 @@ // REQUIRES: system-darwin -// RUN: %clang -target x86_64-apple-darwin10 -fsyntax-only -std=c11 -isysroot %S/Inputs %s +// RUN: %clang -target x86_64-apple-darwin11 -fsyntax-only -std=c11 -isysroot %S/Inputs %s #include // Test the #include_next on float.h works on Darwin. diff --git a/clang/test/Headers/tgmath-darwin.c b/clang/test/Headers/tgmath-darwin.c index 916605a..8323b75 100644 --- a/clang/test/Headers/tgmath-darwin.c +++ b/clang/test/Headers/tgmath-darwin.c @@ -1,5 +1,5 @@ // REQUIRES: system-darwin -// RUN: %clang -target x86_64-apple-darwin10 -fsyntax-only -std=c11 -isysroot %S/Inputs %s +// RUN: %clang -target x86_64-apple-darwin11 -fsyntax-only -std=c11 -isysroot %S/Inputs %s #include // Test the #include_next of tgmath.h works on Darwin. diff --git a/clang/test/PCH/reloc.c b/clang/test/PCH/reloc.c index 14788f0..435fde2 100644 --- a/clang/test/PCH/reloc.c +++ b/clang/test/PCH/reloc.c @@ -1,8 +1,8 @@ -// RUN: %clang -target x86_64-apple-darwin10 --relocatable-pch -o %t \ +// RUN: %clang -target x86_64-apple-darwin11 --relocatable-pch -o %t \ // RUN: -isysroot %S/Inputs/libroot %S/Inputs/libroot/usr/include/reloc.h -// RUN: %clang -target x86_64-apple-darwin10 -fsyntax-only \ +// RUN: %clang -target x86_64-apple-darwin11 -fsyntax-only \ // RUN: -include-pch %t -isysroot %S/Inputs/libroot %s -Xclang -verify -// RUN: not %clang -target x86_64-apple-darwin10 -include-pch %t %s +// RUN: not %clang -target x86_64-apple-darwin11 -include-pch %t %s // REQUIRES: x86-registered-target #include diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py index fd2c4fe..7922165 100644 --- a/clang/test/lit.cfg.py +++ b/clang/test/lit.cfg.py @@ -134,7 +134,7 @@ if config.clang_enable_opaque_pointers: # Set available features we allow tests to conditionalize on. # if config.clang_default_cxx_stdlib != '': - config.available_features.add('default-cxx-stdlib-set') + config.available_features.add('default-cxx-stdlib={}'.format(config.clang_default_cxx_stdlib)) # As of 2011.08, crash-recovery tests still do not pass on FreeBSD. if platform.system() not in ['FreeBSD']: