1// Test for assertion failure due to objc_externally_retained on a function. 2 3// Without PCH 4// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-arc -include %s %s 5 6// With PCH 7// RUN: %clang_cc1 %s -emit-pch -fobjc-arc -o %t 8// RUN: %clang_cc1 -emit-llvm-only -verify %s -fobjc-arc -include-pch %t -debug-info-kind=limited 9 10// expected-no-diagnostics 11 12#ifndef HEADER 13#define HEADER 14//===----------------------------------------------------------------------===// 15// Header 16 17__attribute__((objc_externally_retained)) void doSomething(id someObject); 18 19id sharedObject = 0; 20 21//===----------------------------------------------------------------------===// 22#else 23//===----------------------------------------------------------------------===// 24 25void callDoSomething() { 26 doSomething(sharedObject); 27} 28 29//===----------------------------------------------------------------------===// 30#endif 31