// RUN: %clang_cc1 %s -triple=armv7-unknown-unknown -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 %s -triple=armv7-unknown-unknown -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 unnamed_addr constant
// CHECK: @_ZTI6Test0a = external constant
// This is still not a key function.
void
/*** Test0b ******************************************************************/
;
// This is still not a key function.
void
// V-table should be defined externally.
// CHECK: @_ZTV6Test0b = external unnamed_addr constant
// CHECK: @_ZTI6Test0b = external constant
/*** Test1a ******************************************************************/
;
// V-table should be defined externally.
// CHECK: @_ZTV6Test1a = external unnamed_addr constant
// CHECK: @_ZTI6Test1a = external constant
// 'bar' becomes the key function when 'foo' is defined inline.
inline void
/*** Test1b ******************************************************************/
;
// 'bar' becomes the key function when 'foo' is defined inline.
inline void
// V-table should be defined externally.
// CHECK: @_ZTV6Test1b = external unnamed_addr constant
// CHECK: @_ZTI6Test1b = external constant
/*** Test2a ******************************************************************/
;
// V-table should be defined with strong linkage.
// CHECK: @_ZTV6Test2a ={{.*}} unnamed_addr constant
// CHECK-LATE: @_ZTS6Test2a ={{.*}} constant
// CHECK-LATE: @_ZTI6Test2a ={{.*}} constant
// 'bar' becomes the key function when 'foo' is defined inline.
void
inline void
/*** Test2b ******************************************************************/
;
// 'bar' becomes the key function when 'foo' is defined inline.
void
// V-table should be defined with strong linkage.
// CHECK: @_ZTV6Test2b ={{.*}} unnamed_addr constant
// CHECK-LATE: @_ZTS6Test2b ={{.*}} constant
// CHECK-LATE: @_ZTI6Test2b ={{.*}} constant
inline void
/*** Test2c ******************************************************************/
;
// 'bar' becomes the key function when 'foo' is defined inline.
void
inline void
// V-table should be defined with strong linkage.
// CHECK: @_ZTV6Test2c ={{.*}} unnamed_addr constant
// CHECK: @_ZTS6Test2c ={{.*}} constant
// CHECK: @_ZTI6Test2c ={{.*}} constant
/*** Test3a ******************************************************************/
;
// V-table should be defined with weak linkage.
// CHECK: @_ZTV6Test3a = linkonce_odr unnamed_addr constant
// CHECK-LATE: @_ZTS6Test3a = linkonce_odr constant
// CHECK-LATE: @_ZTI6Test3a = linkonce_odr constant
// There ceases to be a key function after these declarations.
inline void
inline void
/*** Test3b ******************************************************************/
;
// There ceases to be a key function after these declarations.
inline void
// V-table should be defined with weak linkage.
// CHECK: @_ZTV6Test3b = linkonce_odr unnamed_addr constant
// CHECK-LATE: @_ZTS6Test3b = linkonce_odr constant
// CHECK-LATE: @_ZTI6Test3b = linkonce_odr constant
inline void
/*** Test3c ******************************************************************/
;
// There ceases to be a key function after these declarations.
inline void
inline void
// V-table should be defined with weak linkage.
// CHECK: @_ZTV6Test3c = linkonce_odr unnamed_addr constant
// CHECK: @_ZTS6Test3c = linkonce_odr constant
// CHECK: @_ZTI6Test3c = linkonce_odr constant
/*** Test4a ******************************************************************/
;
// V-table should be defined with weak linkage.
Test4a<int>
// CHECK: @_ZTV6Test4aIiE = linkonce_odr unnamed_addr constant
// CHECK: @_ZTS6Test4aIiE = linkonce_odr constant
// CHECK: @_ZTI6Test4aIiE = linkonce_odr constant
// There ceases to be a key function after these declarations.
inline void
inline void
/*** Test4b ******************************************************************/
;
// There ceases to be a key function after these declarations.
inline void
// V-table should be defined with weak linkage.
Test4b<int>
// CHECK: @_ZTV6Test4bIiE = linkonce_odr unnamed_addr constant
// CHECK: @_ZTS6Test4bIiE = linkonce_odr constant
// CHECK: @_ZTI6Test4bIiE = linkonce_odr constant
inline void
/*** Test4c ******************************************************************/
;
// There ceases to be a key function after these declarations.
inline void
inline void
// V-table should be defined with weak linkage.
Test4c<int>
// CHECK: @_ZTV6Test4cIiE = linkonce_odr unnamed_addr constant
// CHECK: @_ZTS6Test4cIiE = linkonce_odr constant
// CHECK: @_ZTI6Test4cIiE = linkonce_odr constant
/*** Test5a ******************************************************************/
;
inline void ;
inline void ;
// V-table should be defined with weak linkage.
Test5a<int>
// CHECK: @_ZTV6Test5aIiE = linkonce_odr unnamed_addr constant
// CHECK: @_ZTS6Test5aIiE = linkonce_odr constant
// CHECK: @_ZTI6Test5aIiE = linkonce_odr constant
// There ceases to be a key function after these declarations.
inline void
inline void
/*** Test5b ******************************************************************/
;
// There ceases to be a key function after these declarations.
inline void ;
inline void
// V-table should be defined with weak linkage.
Test5b<int>
// CHECK: @_ZTV6Test5bIiE = linkonce_odr unnamed_addr constant
// CHECK: @_ZTS6Test5bIiE = linkonce_odr constant
// CHECK: @_ZTI6Test5bIiE = linkonce_odr constant
inline void ;
inline void
/*** Test5c ******************************************************************/
;
// There ceases to be a key function after these declarations.
inline void ;
inline void ;
inline void
inline void
// V-table should be defined with weak linkage.
Test5c<int>
// CHECK: @_ZTV6Test5cIiE = linkonce_odr unnamed_addr constant
// CHECK: @_ZTS6Test5cIiE = linkonce_odr constant
// CHECK: @_ZTI6Test5cIiE = linkonce_odr constant