// RUN: %clang_cc1 %s -triple=armv7-apple-darwin -emit-llvm -o - | FileCheck -check-prefixes=CHECK,CHECK-UNIX %s
// RUN: %clang_cc1 %s -triple=armv7-apple-darwin -emit-llvm -o - | FileCheck -check-prefix=CHECK-LATE %s
// RUN: %clang_cc1 %s -triple=x86_64-pc-windows-gnu -emit-llvm -o - | FileCheck -check-prefixes=CHECK,CHECK-MINGW %s
// RUN: %clang_cc1 %s -triple=x86_64-pc-windows-gnu -emit-llvm -o - | FileCheck -check-prefix=CHECK-LATE %s
// The 'a' variants ask for the vtable first.
// The 'b' variants ask for the vtable second.
// The 'c' variants ask for the vtable third.
// We do a separate CHECK-LATE pass because the RTTI definition gets
// changed after the fact, which causes reordering of the globals.
// These are not separated into namespaces because the way that Sema
// currently reports namespaces to IR-generation (i.e., en masse for
// the entire namespace at once) subverts the ordering that we're
// trying to test.
extern void ;
/*** Test0a ******************************************************************/
;
// V-table should be defined externally.
// CHECK: @_ZTV6Test0a = external {{(dso_local )?}}unnamed_addr constant
// CHECK-UNIX: @_ZTI6Test0a = external {{(dso_local )?}}constant
// CHECK-MINGW: @_ZTI6Test0a = linkonce_odr {{(dso_local )?}}constant
// This is not a key function.
void
/*** Test0b ******************************************************************/
;
// This is not a key function.
void
// V-table should be defined externally.
// CHECK: @_ZTV6Test0b = external {{(dso_local )?}}unnamed_addr constant
// CHECK-UNIX: @_ZTI6Test0b = external {{(dso_local )?}}constant
// CHECK-MINGW: @_ZTI6Test0b = linkonce_odr {{(dso_local )?}}constant
/*** Test1a ******************************************************************/
;
// V-table needs to be defined weakly.
// CHECK: @_ZTV6Test1a = linkonce_odr {{(dso_local )?}}unnamed_addr constant
// CHECK-LATE: @_ZTS6Test1a = linkonce_odr {{(dso_local )?}}constant
// CHECK-LATE: @_ZTI6Test1a = linkonce_odr {{(dso_local )?}}constant
// This defines the key function.
inline void
/*** Test1b ******************************************************************/
;
// This defines the key function.
inline void
// V-table should be defined weakly..
// CHECK: @_ZTV6Test1b = linkonce_odr {{(dso_local )?}}unnamed_addr constant
// CHECK: @_ZTS6Test1b = linkonce_odr {{(dso_local )?}}constant
// CHECK: @_ZTI6Test1b = linkonce_odr {{(dso_local )?}}constant
/*** Test2a ******************************************************************/
;
// V-table should be defined with weak linkage.
// CHECK: @_ZTV6Test2a = linkonce_odr {{(dso_local )?}}unnamed_addr constant
// CHECK-LATE: @_ZTS6Test2a = linkonce_odr {{(dso_local )?}}constant
// CHECK-LATE: @_ZTI6Test2a = linkonce_odr {{(dso_local )?}}constant
void
inline void
/*** Test2b ******************************************************************/
;
void
// V-table should be defined with weak linkage.
// CHECK: @_ZTV6Test2b = linkonce_odr {{(dso_local )?}}unnamed_addr constant
// CHECK-LATE: @_ZTS6Test2b = linkonce_odr {{(dso_local )?}}constant
// CHECK-LATE: @_ZTI6Test2b = linkonce_odr {{(dso_local )?}}constant
inline void
/*** Test2c ******************************************************************/
;
void
inline void
// V-table should be defined with weak linkage.
// CHECK: @_ZTV6Test2c = linkonce_odr {{(dso_local )?}}unnamed_addr constant
// CHECK: @_ZTS6Test2c = linkonce_odr {{(dso_local )?}}constant
// CHECK: @_ZTI6Test2c = linkonce_odr {{(dso_local )?}}constant
/*** Test3a ******************************************************************/
;
// V-table should be defined with weak linkage.
// CHECK: @_ZTV6Test3a = linkonce_odr {{(dso_local )?}}unnamed_addr constant
// CHECK-LATE: @_ZTS6Test3a = linkonce_odr {{(dso_local )?}}constant
// CHECK-LATE: @_ZTI6Test3a = linkonce_odr {{(dso_local )?}}constant
// This defines the key function.
inline void
inline void
/*** Test3b ******************************************************************/
;
inline void
// V-table should be defined with weak linkage.
// CHECK: @_ZTV6Test3b = linkonce_odr {{(dso_local )?}}unnamed_addr constant
// CHECK-LATE: @_ZTS6Test3b = linkonce_odr {{(dso_local )?}}constant
// CHECK-LATE: @_ZTI6Test3b = linkonce_odr {{(dso_local )?}}constant
// This defines the key function.
inline void
/*** Test3c ******************************************************************/
;
// This defines the key function.
inline void
inline void
// V-table should be defined with weak linkage.
// CHECK: @_ZTV6Test3c = linkonce_odr {{(dso_local )?}}unnamed_addr constant
// CHECK: @_ZTS6Test3c = linkonce_odr {{(dso_local )?}}constant
// CHECK: @_ZTI6Test3c = linkonce_odr {{(dso_local )?}}constant