// This is an IR generation test because the calculation of visibility
// during IR gen will cause linkage to be implicitly recomputed and
// compared against the earlier cached value. If we had a way of
// testing linkage directly in Sema, that would be better.
// RUN: %clang_cc1 -no-opaque-pointers -Werror -Wno-non-c-typedef-for-linkage -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
// CHECK: @_ZZN5test61A3fooEvE3bar = linkonce_odr global i32 0, align 4
// PR8926
// PR9316: Ensure that even non-namespace-scope function declarations in
// a C declaration context respect that over the anonymous namespace.
extern "C"
// CHECK: define linkonce_odr noundef i8* @_ZN5test11A3fooILj0EEEPvv(
// CHECK: define linkonce_odr noundef i8* @_ZN5test21A1BILj0EE3fooEv(
// Test that we don't compute linkage too hastily before we're done
// processing a record decl. rdar://15928125