blob: 64b390c3071572709eb276b314f02b6851216305 [file] [log] [blame]
John McCallf85e1932011-06-15 23:02:42 +00001// Test this without pch.
John McCalld1e40d52011-10-02 01:16:38 +00002// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include %S/Inputs/arc.h -fsyntax-only -emit-llvm-only %s
John McCallf85e1932011-06-15 23:02:42 +00003
4// Test with pch.
John McCalld1e40d52011-10-02 01:16:38 +00005// RUN: %clang_cc1 -emit-pch -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -x objective-c-header -o %t %S/Inputs/arc.h
6// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include-pch %t -fsyntax-only -emit-llvm-only %s
Argyrios Kyrtzidis428382c2011-07-21 21:56:04 +00007
8// Test error when pch's -fobjc-arc state is different.
John McCalld1e40d52011-10-02 01:16:38 +00009// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -include-pch %t -fsyntax-only -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=ERR1 %s
10// RUN: %clang_cc1 -emit-pch -fblocks -triple x86_64-apple-darwin11 -x objective-c-header -o %t %S/Inputs/arc.h
11// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include-pch %t -fsyntax-only -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=ERR2 %s
John McCallf85e1932011-06-15 23:02:42 +000012
13array0 a0;
14array1 a1;
Argyrios Kyrtzidis428382c2011-07-21 21:56:04 +000015
Douglas Gregor7d5e81b2011-09-13 18:26:39 +000016// CHECK-ERR1: Objective-C automated reference counting was enabled in PCH file but is currently disabled
17// CHECK-ERR2: Objective-C automated reference counting was disabled in PCH file but is currently enabled