From: Argyrios Kyrtzidis Date: Thu, 21 Jul 2011 21:56:04 +0000 (+0000) Subject: Fix diagnostic when loading a PCH which has different enabled/disabled state of ... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=428382c1ae2e867604ace65713345c9b6cd7e95e;p=clang Fix diagnostic when loading a PCH which has different enabled/disabled state of -fobjc-arc. rdar://9818341 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135707 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td index 120ba67dc1..8b2f2f34d5 100644 --- a/include/clang/Basic/DiagnosticFrontendKinds.td +++ b/include/clang/Basic/DiagnosticFrontendKinds.td @@ -138,8 +138,8 @@ def warn_pch_nonfragile_abi2 : Error< "Objective-C ABI but the %select{32-bit|enhanced non-fragile}1 " "Objective-C ABI is selected">; def warn_pch_auto_ref_count : Error< - "PCH file was compiled %select{without|with} automated reference counting," - "which is currently %select{disabled|enabled}">; + "PCH file was compiled %select{without|with}0 automated reference counting," + " which is currently %select{disabled|enabled}1">; def warn_pch_apple_kext : Error< "PCH file was compiled %select{with|without}0 support for Apple's kernel " "extensions ABI but it is currently %select{disabled|enabled}1">; diff --git a/test/PCH/arc.m b/test/PCH/arc.m index 6f7b8704d9..84a8ccc24a 100644 --- a/test/PCH/arc.m +++ b/test/PCH/arc.m @@ -1,9 +1,17 @@ // Test this without pch. -// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fobjc-arc -include %S/Inputs/arc.h -fsyntax-only -emit-llvm -o - %s +// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fobjc-arc -include %S/Inputs/arc.h -fsyntax-only -emit-llvm-only %s // Test with pch. // RUN: %clang_cc1 -emit-pch -fblocks -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fobjc-arc -x objective-c-header -o %t %S/Inputs/arc.h -// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fobjc-arc -include-pch %t -fsyntax-only -emit-llvm -o - %s +// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fobjc-arc -include-pch %t -fsyntax-only -emit-llvm-only %s + +// Test error when pch's -fobjc-arc state is different. +// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -include-pch %t -fsyntax-only -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=ERR1 %s +// RUN: %clang_cc1 -emit-pch -fblocks -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -x objective-c-header -o %t %S/Inputs/arc.h +// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fobjc-arc -include-pch %t -fsyntax-only -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=ERR2 %s array0 a0; array1 a1; + +// CHECK-ERR1: PCH file was compiled with automated reference counting, which is currently disabled +// CHECK-ERR2: PCH file was compiled without automated reference counting, which is currently enabled