svn commit: r343193 - in vendor/clang/dist-release_80: include/clang/Basic lib/Basic lib/CodeGen lib/Sema test/CodeGen test/CodeGenCXX test/Driver test/Sema test/SemaObjC test/Tooling
Dimitry Andric
dim at FreeBSD.org
Sat Jan 19 18:44:53 UTC 2019
Author: dim
Date: Sat Jan 19 18:44:43 2019
New Revision: 343193
URL: https://svnweb.freebsd.org/changeset/base/343193
Log:
Vendor import of clang release_80 branch r351543:
https://llvm.org/svn/llvm-project/cfe/branches/release_80@351543
Added:
vendor/clang/dist-release_80/test/CodeGen/attr-msp430.c
vendor/clang/dist-release_80/test/CodeGenCXX/cxx11-thread-local-visibility.cpp
Modified:
vendor/clang/dist-release_80/include/clang/Basic/DiagnosticSemaKinds.td
vendor/clang/dist-release_80/lib/Basic/Version.cpp
vendor/clang/dist-release_80/lib/CodeGen/ItaniumCXXABI.cpp
vendor/clang/dist-release_80/lib/CodeGen/TargetInfo.cpp
vendor/clang/dist-release_80/lib/Sema/SemaDeclAttr.cpp
vendor/clang/dist-release_80/test/CodeGenCXX/cxx11-thread-local.cpp
vendor/clang/dist-release_80/test/Driver/msp430-toolchain.c
vendor/clang/dist-release_80/test/Sema/attr-msp430.c
vendor/clang/dist-release_80/test/SemaObjC/call-unavailable-init-in-self.m
vendor/clang/dist-release_80/test/SemaObjC/infer-availability-from-init.m
vendor/clang/dist-release_80/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp
Modified: vendor/clang/dist-release_80/include/clang/Basic/DiagnosticSemaKinds.td
==============================================================================
--- vendor/clang/dist-release_80/include/clang/Basic/DiagnosticSemaKinds.td Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/include/clang/Basic/DiagnosticSemaKinds.td Sat Jan 19 18:44:43 2019 (r343193)
@@ -274,6 +274,10 @@ def warn_riscv_interrupt_attribute : Warning<
"RISC-V 'interrupt' attribute only applies to functions that have "
"%select{no parameters|a 'void' return type}0">,
InGroup<IgnoredAttributes>;
+def warn_msp430_interrupt_attribute : Warning<
+ "MSP430 'interrupt' attribute only applies to functions that have "
+ "%select{no parameters|a 'void' return type}0">,
+ InGroup<IgnoredAttributes>;
def warn_unused_parameter : Warning<"unused parameter %0">,
InGroup<UnusedParameter>, DefaultIgnore;
def warn_unused_variable : Warning<"unused variable %0">,
Modified: vendor/clang/dist-release_80/lib/Basic/Version.cpp
==============================================================================
--- vendor/clang/dist-release_80/lib/Basic/Version.cpp Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/lib/Basic/Version.cpp Sat Jan 19 18:44:43 2019 (r343193)
@@ -36,7 +36,7 @@ std::string getClangRepositoryPath() {
// If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
// pick up a tag in an SVN export, for example.
- StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/trunk/lib/Basic/Version.cpp $");
+ StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_80/lib/Basic/Version.cpp $");
if (URL.empty()) {
URL = SVNRepository.slice(SVNRepository.find(':'),
SVNRepository.find("/lib/Basic"));
Modified: vendor/clang/dist-release_80/lib/CodeGen/ItaniumCXXABI.cpp
==============================================================================
--- vendor/clang/dist-release_80/lib/CodeGen/ItaniumCXXABI.cpp Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/lib/CodeGen/ItaniumCXXABI.cpp Sat Jan 19 18:44:43 2019 (r343193)
@@ -2463,10 +2463,12 @@ ItaniumCXXABI::getOrCreateThreadLocalWrapper(const Var
CGM.SetLLVMFunctionAttributesForDefinition(nullptr, Wrapper);
// Always resolve references to the wrapper at link time.
- if (!Wrapper->hasLocalLinkage() && !(isThreadWrapperReplaceable(VD, CGM) &&
- !llvm::GlobalVariable::isLinkOnceLinkage(Wrapper->getLinkage()) &&
- !llvm::GlobalVariable::isWeakODRLinkage(Wrapper->getLinkage())))
- Wrapper->setVisibility(llvm::GlobalValue::HiddenVisibility);
+ if (!Wrapper->hasLocalLinkage())
+ if (!isThreadWrapperReplaceable(VD, CGM) ||
+ llvm::GlobalVariable::isLinkOnceLinkage(Wrapper->getLinkage()) ||
+ llvm::GlobalVariable::isWeakODRLinkage(Wrapper->getLinkage()) ||
+ VD->getVisibility() == HiddenVisibility)
+ Wrapper->setVisibility(llvm::GlobalValue::HiddenVisibility);
if (isThreadWrapperReplaceable(VD, CGM)) {
Wrapper->setCallingConv(llvm::CallingConv::CXX_FAST_TLS);
Modified: vendor/clang/dist-release_80/lib/CodeGen/TargetInfo.cpp
==============================================================================
--- vendor/clang/dist-release_80/lib/CodeGen/TargetInfo.cpp Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/lib/CodeGen/TargetInfo.cpp Sat Jan 19 18:44:43 2019 (r343193)
@@ -6774,21 +6774,19 @@ void MSP430TargetCodeGenInfo::setTargetAttributes(
if (GV->isDeclaration())
return;
if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) {
- if (const MSP430InterruptAttr *attr = FD->getAttr<MSP430InterruptAttr>()) {
- // Handle 'interrupt' attribute:
- llvm::Function *F = cast<llvm::Function>(GV);
+ const auto *InterruptAttr = FD->getAttr<MSP430InterruptAttr>();
+ if (!InterruptAttr)
+ return;
- // Step 1: Set ISR calling convention.
- F->setCallingConv(llvm::CallingConv::MSP430_INTR);
+ // Handle 'interrupt' attribute:
+ llvm::Function *F = cast<llvm::Function>(GV);
- // Step 2: Add attributes goodness.
- F->addFnAttr(llvm::Attribute::NoInline);
+ // Step 1: Set ISR calling convention.
+ F->setCallingConv(llvm::CallingConv::MSP430_INTR);
- // Step 3: Emit ISR vector alias.
- unsigned Num = attr->getNumber() / 2;
- llvm::GlobalAlias::create(llvm::Function::ExternalLinkage,
- "__isr_" + Twine(Num), F);
- }
+ // Step 2: Add attributes goodness.
+ F->addFnAttr(llvm::Attribute::NoInline);
+ F->addFnAttr("interrupt", llvm::utostr(InterruptAttr->getNumber()));
}
}
Modified: vendor/clang/dist-release_80/lib/Sema/SemaDeclAttr.cpp
==============================================================================
--- vendor/clang/dist-release_80/lib/Sema/SemaDeclAttr.cpp Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/lib/Sema/SemaDeclAttr.cpp Sat Jan 19 18:44:43 2019 (r343193)
@@ -5377,6 +5377,27 @@ static void handleARMInterruptAttr(Sema &S, Decl *D, c
}
static void handleMSP430InterruptAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
+ // MSP430 'interrupt' attribute is applied to
+ // a function with no parameters and void return type.
+ if (!isFunctionOrMethod(D)) {
+ S.Diag(D->getLocation(), diag::warn_attribute_wrong_decl_type)
+ << "'interrupt'" << ExpectedFunctionOrMethod;
+ return;
+ }
+
+ if (hasFunctionProto(D) && getFunctionOrMethodNumParams(D) != 0) {
+ S.Diag(D->getLocation(), diag::warn_msp430_interrupt_attribute)
+ << 0;
+ return;
+ }
+
+ if (!getFunctionOrMethodResultType(D)->isVoidType()) {
+ S.Diag(D->getLocation(), diag::warn_msp430_interrupt_attribute)
+ << 1;
+ return;
+ }
+
+ // The attribute takes one integer argument.
if (!checkAttributeNumArgs(S, AL, 1))
return;
@@ -5386,8 +5407,6 @@ static void handleMSP430InterruptAttr(Sema &S, Decl *D
return;
}
- // FIXME: Check for decl - it should be void ()(void).
-
Expr *NumParamsExpr = static_cast<Expr *>(AL.getArgAsExpr(0));
llvm::APSInt NumParams(32);
if (!NumParamsExpr->isIntegerConstantExpr(NumParams, S.Context)) {
@@ -5396,9 +5415,9 @@ static void handleMSP430InterruptAttr(Sema &S, Decl *D
<< NumParamsExpr->getSourceRange();
return;
}
-
+ // The argument should be in range 0..63.
unsigned Num = NumParams.getLimitedValue(255);
- if ((Num & 1) || Num > 30) {
+ if (Num > 63) {
S.Diag(AL.getLoc(), diag::err_attribute_argument_out_of_bounds)
<< AL << (int)NumParams.getSExtValue()
<< NumParamsExpr->getSourceRange();
@@ -7346,13 +7365,11 @@ ShouldDiagnoseAvailabilityInContext(Sema &S, Availabil
return true;
} else if (K == AR_Unavailable) {
// It is perfectly fine to refer to an 'unavailable' Objective-C method
- // when it's actually defined and is referenced from within the
- // @implementation itself. In this context, we interpret unavailable as a
- // form of access control.
+ // when it is referenced from within the @implementation itself. In this
+ // context, we interpret unavailable as a form of access control.
if (const auto *MD = dyn_cast<ObjCMethodDecl>(OffendingDecl)) {
if (const auto *Impl = dyn_cast<ObjCImplDecl>(C)) {
- if (MD->getClassInterface() == Impl->getClassInterface() &&
- MD->isDefined())
+ if (MD->getClassInterface() == Impl->getClassInterface())
return true;
}
}
Added: vendor/clang/dist-release_80/test/CodeGen/attr-msp430.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/clang/dist-release_80/test/CodeGen/attr-msp430.c Sat Jan 19 18:44:43 2019 (r343193)
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple msp430-unknown-unknown -emit-llvm < %s| FileCheck %s
+
+__attribute__((interrupt(1))) void foo(void) {}
+// CHECK: @llvm.used
+// CHECK-SAME: @foo
+
+// CHECK: define msp430_intrcc void @foo() #0
+// CHECK: attributes #0
+// CHECK-SAME: noinline
+// CHECK-SAME: "interrupt"="1"
Added: vendor/clang/dist-release_80/test/CodeGenCXX/cxx11-thread-local-visibility.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/clang/dist-release_80/test/CodeGenCXX/cxx11-thread-local-visibility.cpp Sat Jan 19 18:44:43 2019 (r343193)
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck --check-prefix=LINUX %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-apple-darwin12 | FileCheck --check-prefix=DARWIN %s
+
+// Regression test for PR40327
+
+// LINUX: @default_tls = thread_local global i32
+// LINUX: @hidden_tls = hidden thread_local global i32
+// LINUX: define weak_odr hidden i32* @_ZTW11default_tls()
+// LINUX: define weak_odr hidden i32* @_ZTW10hidden_tls()
+//
+// DARWIN: @default_tls = internal thread_local global i32
+// DARWIN: @hidden_tls = internal thread_local global i32
+// DARWIN: define cxx_fast_tlscc i32* @_ZTW11default_tls()
+// DARWIN: define hidden cxx_fast_tlscc i32* @_ZTW10hidden_tls()
+
+__attribute__((visibility("default"))) thread_local int default_tls;
+__attribute__((visibility("hidden"))) thread_local int hidden_tls;
Modified: vendor/clang/dist-release_80/test/CodeGenCXX/cxx11-thread-local.cpp
==============================================================================
--- vendor/clang/dist-release_80/test/CodeGenCXX/cxx11-thread-local.cpp Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/test/CodeGenCXX/cxx11-thread-local.cpp Sat Jan 19 18:44:43 2019 (r343193)
@@ -318,7 +318,7 @@ void set_anon_i() {
// CHECK-NOT: call void @[[V_M_INIT]]()
-// LIUNX: define weak_odr hidden i32* @_ZTW1a() {
+// LINUX: define weak_odr hidden i32* @_ZTW1a()
// DARWIN: define cxx_fast_tlscc i32* @_ZTW1a()
// LINUX: call void @_ZTH1a()
// DARWIN: call cxx_fast_tlscc void @_ZTH1a()
Modified: vendor/clang/dist-release_80/test/Driver/msp430-toolchain.c
==============================================================================
--- vendor/clang/dist-release_80/test/Driver/msp430-toolchain.c Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/test/Driver/msp430-toolchain.c Sat Jan 19 18:44:43 2019 (r343193)
@@ -8,44 +8,44 @@
// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430 %s
-// MSP430: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld"
+// MSP430: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld"
// MSP430: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430"
-// MSP430: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430"
-// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crt0.o"
-// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtbegin.o"
+// MSP430: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430"
+// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430{{/|\\\\}}crt0.o"
+// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430{{/|\\\\}}crtbegin.o"
// MSP430: "--start-group" "-lmul_none" "-lgcc" "-lc" "-lcrt" "-lnosys" "--end-group"
-// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtend.o"
-// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crtn.o"
+// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430{{/|\\\\}}crtend.o"
+// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430{{/|\\\\}}crtn.o"
// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nodefaultlibs \
// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-NO-DFT-LIB %s
-// MSP430-NO-DFT-LIB: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld"
+// MSP430-NO-DFT-LIB: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld"
// MSP430-NO-DFT-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430"
-// MSP430-NO-DFT-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430"
-// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crt0.o"
-// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtbegin.o"
+// MSP430-NO-DFT-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430"
+// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430{{/|\\\\}}crt0.o"
+// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430{{/|\\\\}}crtbegin.o"
// MSP430-NO-DFT-LIB: "--start-group" "-lmul_none" "-lgcc" "--end-group"
-// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtend.o"
-// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crtn.o"
+// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430{{/|\\\\}}crtend.o"
+// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430{{/|\\\\}}crtn.o"
// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nostartfiles \
// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-NO-START %s
-// MSP430-NO-START: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld"
+// MSP430-NO-START: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld"
// MSP430-NO-START: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430"
-// MSP430-NO-START: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430"
+// MSP430-NO-START: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430"
// MSP430-NO-START: "--start-group" "-lmul_none" "-lgcc" "-lc" "-lcrt" "-lnosys" "--end-group"
// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nostdlib \
// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-NO-STD-LIB %s
-// MSP430-NO-STD-LIB: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld"
+// MSP430-NO-STD-LIB: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld"
// MSP430-NO-STD-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430"
-// MSP430-NO-STD-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430"
+// MSP430-NO-STD-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430"
// MSP430-NO-STD-LIB: "--start-group" "-lmul_none" "-lgcc" "--end-group"
// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f147 2>&1 \
Modified: vendor/clang/dist-release_80/test/Sema/attr-msp430.c
==============================================================================
--- vendor/clang/dist-release_80/test/Sema/attr-msp430.c Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/test/Sema/attr-msp430.c Sat Jan 19 18:44:43 2019 (r343193)
@@ -1,6 +1,13 @@
// RUN: %clang_cc1 -triple msp430-unknown-unknown -fsyntax-only -verify %s
+__attribute__((interrupt(1))) int t; // expected-warning {{'interrupt' attribute only applies to functions}}
+
int i;
-void f(void) __attribute__((interrupt(i))); /* expected-error {{'interrupt' attribute requires an integer constant}} */
+__attribute__((interrupt(i))) void f(void); // expected-error {{'interrupt' attribute requires an integer constant}}
+__attribute__((interrupt(1, 2))) void f2(void); // expected-error {{'interrupt' attribute takes one argument}}
+__attribute__((interrupt(1))) int f3(void); // expected-warning {{MSP430 'interrupt' attribute only applies to functions that have a 'void' return type}}
+__attribute__((interrupt(1))) void f4(int a); // expected-warning {{MSP430 'interrupt' attribute only applies to functions that have no parameters}}
+__attribute__((interrupt(64))) void f5(void); // expected-error {{'interrupt' attribute parameter 64 is out of bounds}}
-void f2(void) __attribute__((interrupt(12)));
+__attribute__((interrupt(0))) void f6(void);
+__attribute__((interrupt(63))) void f7(void);
Modified: vendor/clang/dist-release_80/test/SemaObjC/call-unavailable-init-in-self.m
==============================================================================
--- vendor/clang/dist-release_80/test/SemaObjC/call-unavailable-init-in-self.m Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/test/SemaObjC/call-unavailable-init-in-self.m Sat Jan 19 18:44:43 2019 (r343193)
@@ -5,14 +5,25 @@
+ (instancetype)new;
+ (instancetype)alloc;
+- (void)declaredInSuper;
+
@end
+ at interface NSObject (Category)
+
+- (void)declaredInSuperCategory;
+
+ at end
+
@interface Sub: NSObject
- (instancetype)init __attribute__((unavailable)); // expected-note 4 {{'init' has been explicitly marked unavailable here}}
-- (void)notImplemented __attribute__((unavailable)); // expected-note {{'notImplemented' has been explicitly marked unavailable here}}
+- (void)notImplemented __attribute__((unavailable));
+- (void)declaredInSuper __attribute__((unavailable));
+- (void)declaredInSuperCategory __attribute__((unavailable));
+
@end
@implementation Sub
@@ -34,7 +45,14 @@
}
- (void)reportUseOfUnimplemented {
- [self notImplemented]; // expected-error {{'notImplemented' is unavailable}}
+ [self notImplemented];
+}
+
+- (void)allowSuperCallUsingSelf {
+ [self declaredInSuper];
+ [[Sub alloc] declaredInSuper];
+ [self declaredInSuperCategory];
+ [[Sub alloc] declaredInSuperCategory];
}
@end
Modified: vendor/clang/dist-release_80/test/SemaObjC/infer-availability-from-init.m
==============================================================================
--- vendor/clang/dist-release_80/test/SemaObjC/infer-availability-from-init.m Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/test/SemaObjC/infer-availability-from-init.m Sat Jan 19 18:44:43 2019 (r343193)
@@ -47,12 +47,12 @@ void usenotmyobject() {
}
@interface FromSelf : NSObject
--(instancetype)init __attribute__((unavailable)); // expected-note {{'init' has been explicitly marked unavailable here}}
+-(instancetype)init __attribute__((unavailable));
+(FromSelf*)another_one;
@end
@implementation FromSelf
+(FromSelf*)another_one {
- [self new]; // expected-error{{'new' is unavailable}}
+ [self new];
}
@end
Modified: vendor/clang/dist-release_80/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp
==============================================================================
--- vendor/clang/dist-release_80/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp Sat Jan 19 18:44:33 2019 (r343192)
+++ vendor/clang/dist-release_80/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp Sat Jan 19 18:44:43 2019 (r343193)
@@ -10,7 +10,7 @@
//
// RUN: cp $(which clang-check) %t/mock-libcxx/bin/
// RUN: cp "%s" "%t/test.cpp"
-// RUN: %t/mock-libcxx/bin/clang-check -p "%t" "%t/test.cpp" -- -stdlib=libc++
-
+// RUN: %t/mock-libcxx/bin/clang-check -p "%t" "%t/test.cpp" -- -stdlib=libc++ -target x86_64-apple-darwin
+// REQUIRES: system-darwin
#include <mock_vector>
vector v;
More information about the svn-src-vendor
mailing list