32 lines · plain
1// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}2// Test for assertion failure due to objc_externally_retained on a function.3 4// Without PCH5// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-arc -include %s %s6 7// With PCH8// RUN: %clang_cc1 %s -emit-pch -fobjc-arc -o %t9// RUN: %clang_cc1 -emit-llvm-only -verify %s -fobjc-arc -include-pch %t -debug-info-kind=limited10 11// expected-no-diagnostics12 13#ifndef HEADER14#define HEADER15//===----------------------------------------------------------------------===//16// Header17 18__attribute__((objc_externally_retained)) void doSomething(id someObject);19 20id sharedObject = 0;21 22//===----------------------------------------------------------------------===//23#else24//===----------------------------------------------------------------------===//25 26void callDoSomething(void) {27 doSomething(sharedObject);28}29 30//===----------------------------------------------------------------------===//31#endif32