head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC6:1.1.1.5
	netbsd-11-0-RC5:1.1.1.5
	netbsd-11-0-RC4:1.1.1.5
	netbsd-11-0-RC3:1.1.1.5
	netbsd-11-0-RC2:1.1.1.5
	netbsd-11-0-RC1:1.1.1.5
	perseant-exfatfs-base-20250801:1.1.1.5
	netbsd-11:1.1.1.5.0.10
	netbsd-11-base:1.1.1.5
	netbsd-10-1-RELEASE:1.1.1.5
	perseant-exfatfs-base-20240630:1.1.1.5
	perseant-exfatfs:1.1.1.5.0.8
	perseant-exfatfs-base:1.1.1.5
	netbsd-8-3-RELEASE:1.1.1.4
	netbsd-9-4-RELEASE:1.1.1.4
	netbsd-10-0-RELEASE:1.1.1.5
	netbsd-10-0-RC6:1.1.1.5
	netbsd-10-0-RC5:1.1.1.5
	netbsd-10-0-RC4:1.1.1.5
	netbsd-10-0-RC3:1.1.1.5
	netbsd-10-0-RC2:1.1.1.5
	netbsd-10-0-RC1:1.1.1.5
	netbsd-10:1.1.1.5.0.6
	netbsd-10-base:1.1.1.5
	netbsd-9-3-RELEASE:1.1.1.4
	cjep_sun2x:1.1.1.5.0.4
	cjep_sun2x-base:1.1.1.5
	cjep_staticlib_x-base1:1.1.1.5
	netbsd-9-2-RELEASE:1.1.1.4
	cjep_staticlib_x:1.1.1.5.0.2
	cjep_staticlib_x-base:1.1.1.5
	netbsd-9-1-RELEASE:1.1.1.4
	phil-wifi-20200421:1.1.1.5
	phil-wifi-20200411:1.1.1.5
	phil-wifi-20200406:1.1.1.5
	netbsd-8-2-RELEASE:1.1.1.4
	netbsd-9-0-RELEASE:1.1.1.4
	netbsd-9-0-RC2:1.1.1.4
	netbsd-9-0-RC1:1.1.1.4
	netbsd-9:1.1.1.4.0.16
	netbsd-9-base:1.1.1.4
	phil-wifi-20190609:1.1.1.4
	netbsd-8-1-RELEASE:1.1.1.4
	netbsd-8-1-RC1:1.1.1.4
	pgoyette-compat-merge-20190127:1.1.1.4
	pgoyette-compat-20190127:1.1.1.4
	pgoyette-compat-20190118:1.1.1.4
	pgoyette-compat-1226:1.1.1.4
	pgoyette-compat-1126:1.1.1.4
	pgoyette-compat-1020:1.1.1.4
	pgoyette-compat-0930:1.1.1.4
	pgoyette-compat-0906:1.1.1.4
	netbsd-7-2-RELEASE:1.1.1.3
	pgoyette-compat-0728:1.1.1.4
	clang-337282:1.1.1.4
	netbsd-8-0-RELEASE:1.1.1.4
	phil-wifi:1.1.1.4.0.14
	phil-wifi-base:1.1.1.4
	pgoyette-compat-0625:1.1.1.4
	netbsd-8-0-RC2:1.1.1.4
	pgoyette-compat-0521:1.1.1.4
	pgoyette-compat-0502:1.1.1.4
	pgoyette-compat-0422:1.1.1.4
	netbsd-8-0-RC1:1.1.1.4
	pgoyette-compat-0415:1.1.1.4
	pgoyette-compat-0407:1.1.1.4
	pgoyette-compat-0330:1.1.1.4
	pgoyette-compat-0322:1.1.1.4
	pgoyette-compat-0315:1.1.1.4
	netbsd-7-1-2-RELEASE:1.1.1.3
	pgoyette-compat:1.1.1.4.0.12
	pgoyette-compat-base:1.1.1.4
	netbsd-7-1-1-RELEASE:1.1.1.3
	clang-319952:1.1.1.4
	matt-nb8-mediatek:1.1.1.4.0.10
	matt-nb8-mediatek-base:1.1.1.4
	clang-309604:1.1.1.4
	perseant-stdc-iso10646:1.1.1.4.0.8
	perseant-stdc-iso10646-base:1.1.1.4
	netbsd-8:1.1.1.4.0.6
	netbsd-8-base:1.1.1.4
	prg-localcount2-base3:1.1.1.4
	prg-localcount2-base2:1.1.1.4
	prg-localcount2-base1:1.1.1.4
	prg-localcount2:1.1.1.4.0.4
	prg-localcount2-base:1.1.1.4
	pgoyette-localcount-20170426:1.1.1.4
	bouyer-socketcan-base1:1.1.1.4
	pgoyette-localcount-20170320:1.1.1.4
	netbsd-7-1:1.1.1.3.0.16
	netbsd-7-1-RELEASE:1.1.1.3
	netbsd-7-1-RC2:1.1.1.3
	clang-294123:1.1.1.4
	netbsd-7-nhusb-base-20170116:1.1.1.3
	bouyer-socketcan:1.1.1.4.0.2
	bouyer-socketcan-base:1.1.1.4
	clang-291444:1.1.1.4
	pgoyette-localcount-20170107:1.1.1.3
	netbsd-7-1-RC1:1.1.1.3
	pgoyette-localcount-20161104:1.1.1.3
	netbsd-7-0-2-RELEASE:1.1.1.3
	localcount-20160914:1.1.1.3
	netbsd-7-nhusb:1.1.1.3.0.14
	netbsd-7-nhusb-base:1.1.1.3
	clang-280599:1.1.1.3
	pgoyette-localcount-20160806:1.1.1.3
	pgoyette-localcount-20160726:1.1.1.3
	pgoyette-localcount:1.1.1.3.0.12
	pgoyette-localcount-base:1.1.1.3
	netbsd-7-0-1-RELEASE:1.1.1.3
	clang-261930:1.1.1.3
	netbsd-7-0:1.1.1.3.0.10
	netbsd-7-0-RELEASE:1.1.1.3
	netbsd-7-0-RC3:1.1.1.3
	netbsd-7-0-RC2:1.1.1.3
	netbsd-7-0-RC1:1.1.1.3
	clang-237755:1.1.1.3
	clang-232565:1.1.1.3
	clang-227398:1.1.1.3
	tls-maxphys-base:1.1.1.3
	tls-maxphys:1.1.1.3.0.8
	netbsd-7:1.1.1.3.0.6
	netbsd-7-base:1.1.1.3
	clang-215315:1.1.1.3
	clang-209886:1.1.1.3
	yamt-pagecache:1.1.1.3.0.4
	yamt-pagecache-base9:1.1.1.3
	tls-earlyentropy:1.1.1.3.0.2
	tls-earlyentropy-base:1.1.1.3
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.3
	riastradh-drm2-base3:1.1.1.3
	clang-202566:1.1.1.3
	clang-201163:1.1.1.3
	clang-199312:1.1.1.2
	clang-198450:1.1.1.2
	clang-196603:1.1.1.1
	clang-195771:1.1.1.1
	LLVM:1.1.1;
locks; strict;
comment	@// @;


1.1
date	2013.11.28.14.14.58;	author joerg;	state Exp;
branches
	1.1.1.1;
next	;
commitid	ow8OybrawrB1f3fx;

1.1.1.1
date	2013.11.28.14.14.58;	author joerg;	state Exp;
branches;
next	1.1.1.2;
commitid	ow8OybrawrB1f3fx;

1.1.1.2
date	2014.01.05.15.40.09;	author joerg;	state Exp;
branches;
next	1.1.1.3;
commitid	wh3aCSIWykURqWjx;

1.1.1.3
date	2014.02.14.20.07.35;	author joerg;	state Exp;
branches
	1.1.1.3.4.1
	1.1.1.3.8.1
	1.1.1.3.12.1;
next	1.1.1.4;
commitid	annVkZ1sc17rF6px;

1.1.1.4
date	2017.01.11.10.39.56;	author joerg;	state Exp;
branches
	1.1.1.4.14.1;
next	1.1.1.5;
commitid	CNnUNfII1jgNmxBz;

1.1.1.5
date	2019.11.13.22.20.15;	author joerg;	state dead;
branches;
next	;
commitid	QD8YATxuNG34YJKB;

1.1.1.3.4.1
date	2014.02.14.20.07.35;	author yamt;	state dead;
branches;
next	1.1.1.3.4.2;
commitid	WSrDtL5nYAUyiyBx;

1.1.1.3.4.2
date	2014.05.22.16.18.57;	author yamt;	state Exp;
branches;
next	;
commitid	WSrDtL5nYAUyiyBx;

1.1.1.3.8.1
date	2014.02.14.20.07.35;	author tls;	state dead;
branches;
next	1.1.1.3.8.2;
commitid	jTnpym9Qu0o4R1Nx;

1.1.1.3.8.2
date	2014.08.19.23.47.59;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.1.1.3.12.1
date	2017.03.20.06.52.59;	author pgoyette;	state Exp;
branches;
next	;
commitid	jjw7cAwgyKq7RfKz;

1.1.1.4.14.1
date	2020.04.13.07.47.29;	author martin;	state dead;
branches;
next	;
commitid	X01YhRUPVUDaec4C;


desc
@@


1.1
log
@Initial revision
@
text
@// 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 v-table first.
// The 'b' variants ask for the v-table second.
// The 'c' variants ask for the v-table third.
// We do a separate CHECK-LATE pass because the RTTI defintion 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.

namespace std { class type_info; }
extern void use(const std::type_info &rtti);

/*** Test0a ******************************************************************/

struct Test0a {
  Test0a();
  virtual inline void foo();
  virtual void bar();
};

// V-table should be defined externally.
Test0a::Test0a() { use(typeid(Test0a)); }
// CHECK: @@_ZTV6Test0a = external unnamed_addr constant 
// CHECK: @@_ZTI6Test0a = external constant

// This is still not a key function.
void Test0a::foo() {}

/*** Test0b ******************************************************************/

struct Test0b {
  Test0b();
  virtual inline void foo();
  virtual void bar();
};

// This is still not a key function.
void Test0b::foo() {}

// V-table should be defined externally.
Test0b::Test0b() { use(typeid(Test0b)); }
// CHECK: @@_ZTV6Test0b = external unnamed_addr constant 
// CHECK: @@_ZTI6Test0b = external constant

/*** Test1a ******************************************************************/

struct Test1a {
  Test1a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined externally.
Test1a::Test1a() { use(typeid(Test1a)); }
// CHECK: @@_ZTV6Test1a = external unnamed_addr constant 
// CHECK: @@_ZTI6Test1a = external constant

// 'bar' becomes the key function when 'foo' is defined inline.
inline void Test1a::foo() {}

/*** Test1b ******************************************************************/

struct Test1b {
  Test1b();
  virtual void foo();
  virtual void bar();
};

// 'bar' becomes the key function when 'foo' is defined inline.
inline void Test1b::foo() {}

// V-table should be defined externally.
Test1b::Test1b() { use(typeid(Test1b)); }
// CHECK: @@_ZTV6Test1b = external unnamed_addr constant 
// CHECK: @@_ZTI6Test1b = external constant

/*** Test2a ******************************************************************/

struct Test2a {
  Test2a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined with strong linkage.
Test2a::Test2a() { use(typeid(Test2a)); }
// CHECK:      @@_ZTV6Test2a = unnamed_addr constant
// CHECK-LATE: @@_ZTS6Test2a = constant
// CHECK-LATE: @@_ZTI6Test2a = unnamed_addr constant

// 'bar' becomes the key function when 'foo' is defined inline.
void Test2a::bar() {}
inline void Test2a::foo() {}

/*** Test2b ******************************************************************/

struct Test2b {
  Test2b();
  virtual void foo();
  virtual void bar();
};

// 'bar' becomes the key function when 'foo' is defined inline.
void Test2b::bar() {}

// V-table should be defined with strong linkage.
Test2b::Test2b() { use(typeid(Test2b)); }
// CHECK:      @@_ZTV6Test2b = unnamed_addr constant
// CHECK-LATE: @@_ZTS6Test2b = constant
// CHECK-LATE: @@_ZTI6Test2b = unnamed_addr constant

inline void Test2b::foo() {}

/*** Test2c ******************************************************************/

struct Test2c {
  Test2c();
  virtual void foo();
  virtual void bar();
};

// 'bar' becomes the key function when 'foo' is defined inline.
void Test2c::bar() {}
inline void Test2c::foo() {}

// V-table should be defined with strong linkage.
Test2c::Test2c() { use(typeid(Test2c)); }
// CHECK: @@_ZTV6Test2c = unnamed_addr constant
// CHECK: @@_ZTS6Test2c = constant
// CHECK: @@_ZTI6Test2c = unnamed_addr constant

/*** Test3a ******************************************************************/

struct Test3a {
  Test3a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined with weak linkage.
Test3a::Test3a() { use(typeid(Test3a)); }
// CHECK:      @@_ZTV6Test3a = linkonce_odr unnamed_addr constant
// CHECK-LATE: @@_ZTS6Test3a = linkonce_odr constant
// CHECK-LATE: @@_ZTI6Test3a = linkonce_odr unnamed_addr constant

// There ceases to be a key function after these declarations.
inline void Test3a::bar() {}
inline void Test3a::foo() {}

/*** Test3b ******************************************************************/

struct Test3b {
  Test3b();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
inline void Test3b::bar() {}

// V-table should be defined with weak linkage.
Test3b::Test3b() { use(typeid(Test3b)); }
// CHECK:      @@_ZTV6Test3b = linkonce_odr unnamed_addr constant
// CHECK-LATE: @@_ZTS6Test3b = linkonce_odr constant
// CHECK-LATE: @@_ZTI6Test3b = linkonce_odr unnamed_addr constant

inline void Test3b::foo() {}

/*** Test3c ******************************************************************/

struct Test3c {
  Test3c();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
inline void Test3c::bar() {}
inline void Test3c::foo() {}

// V-table should be defined with weak linkage.
Test3c::Test3c() { use(typeid(Test3c)); }
// CHECK: @@_ZTV6Test3c = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test3c = linkonce_odr constant
// CHECK: @@_ZTI6Test3c = linkonce_odr unnamed_addr constant

/*** Test4a ******************************************************************/

template <class T> struct Test4a {
  Test4a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined with weak linkage.
template <> Test4a<int>::Test4a() { use(typeid(Test4a)); }
// CHECK: @@_ZTV6Test4aIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test4aIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test4aIiE = linkonce_odr unnamed_addr constant

// There ceases to be a key function after these declarations.
template <> inline void Test4a<int>::bar() {}
template <> inline void Test4a<int>::foo() {}

/*** Test4b ******************************************************************/

template <class T> struct Test4b {
  Test4b();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test4b<int>::bar() {}

// V-table should be defined with weak linkage.
template <> Test4b<int>::Test4b() { use(typeid(Test4b)); }
// CHECK: @@_ZTV6Test4bIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test4bIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test4bIiE = linkonce_odr unnamed_addr constant

template <> inline void Test4b<int>::foo() {}

/*** Test4c ******************************************************************/

template <class T> struct Test4c {
  Test4c();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test4c<int>::bar() {}
template <> inline void Test4c<int>::foo() {}

// V-table should be defined with weak linkage.
template <> Test4c<int>::Test4c() { use(typeid(Test4c)); }
// CHECK: @@_ZTV6Test4cIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test4cIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test4cIiE = linkonce_odr unnamed_addr constant

/*** Test5a ******************************************************************/

template <class T> struct Test5a {
  Test5a();
  virtual void foo();
  virtual void bar();
};

template <> inline void Test5a<int>::bar();
template <> inline void Test5a<int>::foo();

// V-table should be defined with weak linkage.
template <> Test5a<int>::Test5a() { use(typeid(Test5a)); }
// CHECK: @@_ZTV6Test5aIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test5aIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test5aIiE = linkonce_odr unnamed_addr constant

// There ceases to be a key function after these declarations.
template <> inline void Test5a<int>::bar() {}
template <> inline void Test5a<int>::foo() {}

/*** Test5b ******************************************************************/

template <class T> struct Test5b {
  Test5b();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test5a<int>::bar();
template <> inline void Test5b<int>::bar() {}

// V-table should be defined with weak linkage.
template <> Test5b<int>::Test5b() { use(typeid(Test5b)); }
// CHECK: @@_ZTV6Test5bIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test5bIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test5bIiE = linkonce_odr unnamed_addr constant

template <> inline void Test5a<int>::foo();
template <> inline void Test5b<int>::foo() {}

/*** Test5c ******************************************************************/

template <class T> struct Test5c {
  Test5c();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test5a<int>::bar();
template <> inline void Test5a<int>::foo();
template <> inline void Test5c<int>::bar() {}
template <> inline void Test5c<int>::foo() {}

// V-table should be defined with weak linkage.
template <> Test5c<int>::Test5c() { use(typeid(Test5c)); }
// CHECK: @@_ZTV6Test5cIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test5cIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test5cIiE = linkonce_odr unnamed_addr constant
@


1.1.1.1
log
@Import Clang 3.4rc1 r195771.
@
text
@@


1.1.1.2
log
@Import clang 3.5svn r198450.
@
text
@d7 1
a7 1
// We do a separate CHECK-LATE pass because the RTTI definition gets
@


1.1.1.3
log
@Import Clang 3.5svn r201163.
@
text
@d94 1
a94 1
// CHECK-LATE: @@_ZTI6Test2a = constant
d115 1
a115 1
// CHECK-LATE: @@_ZTI6Test2b = constant
d135 1
a135 1
// CHECK: @@_ZTI6Test2c = constant
d149 1
a149 1
// CHECK-LATE: @@_ZTI6Test3a = linkonce_odr constant
d170 1
a170 1
// CHECK-LATE: @@_ZTI6Test3b = linkonce_odr constant
d190 1
a190 1
// CHECK: @@_ZTI6Test3c = linkonce_odr constant
d204 1
a204 1
// CHECK: @@_ZTI6Test4aIiE = linkonce_odr constant
d225 1
a225 1
// CHECK: @@_ZTI6Test4bIiE = linkonce_odr constant
d245 1
a245 1
// CHECK: @@_ZTI6Test4cIiE = linkonce_odr constant
d262 1
a262 1
// CHECK: @@_ZTI6Test5aIiE = linkonce_odr constant
d284 1
a284 1
// CHECK: @@_ZTI6Test5bIiE = linkonce_odr constant
d307 1
a307 1
// CHECK: @@_ZTI6Test5cIiE = linkonce_odr constant
@


1.1.1.3.12.1
log
@Sync with HEAD
@
text
@d4 3
a6 3
// The 'a' variants ask for the vtable first.
// The 'b' variants ask for the vtable second.
// The 'c' variants ask for the vtable third.
@


1.1.1.4
log
@Import Clang pre-4.0.0 r291444.
@
text
@d4 3
a6 3
// The 'a' variants ask for the vtable first.
// The 'b' variants ask for the vtable second.
// The 'c' variants ask for the vtable third.
@


1.1.1.4.14.1
log
@Mostly merge changes from HEAD upto 20200411
@
text
@@


1.1.1.5
log
@Mark old LLVM instance as dead.
@
text
@@


1.1.1.3.8.1
log
@file vtable-key-function-arm.cpp was added on branch tls-maxphys on 2014-08-19 23:47:59 +0000
@
text
@d1 307
@


1.1.1.3.8.2
log
@Rebase to HEAD as of a few days ago.
@
text
@a0 307
// 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 v-table first.
// The 'b' variants ask for the v-table second.
// The 'c' variants ask for the v-table 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.

namespace std { class type_info; }
extern void use(const std::type_info &rtti);

/*** Test0a ******************************************************************/

struct Test0a {
  Test0a();
  virtual inline void foo();
  virtual void bar();
};

// V-table should be defined externally.
Test0a::Test0a() { use(typeid(Test0a)); }
// CHECK: @@_ZTV6Test0a = external unnamed_addr constant 
// CHECK: @@_ZTI6Test0a = external constant

// This is still not a key function.
void Test0a::foo() {}

/*** Test0b ******************************************************************/

struct Test0b {
  Test0b();
  virtual inline void foo();
  virtual void bar();
};

// This is still not a key function.
void Test0b::foo() {}

// V-table should be defined externally.
Test0b::Test0b() { use(typeid(Test0b)); }
// CHECK: @@_ZTV6Test0b = external unnamed_addr constant 
// CHECK: @@_ZTI6Test0b = external constant

/*** Test1a ******************************************************************/

struct Test1a {
  Test1a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined externally.
Test1a::Test1a() { use(typeid(Test1a)); }
// CHECK: @@_ZTV6Test1a = external unnamed_addr constant 
// CHECK: @@_ZTI6Test1a = external constant

// 'bar' becomes the key function when 'foo' is defined inline.
inline void Test1a::foo() {}

/*** Test1b ******************************************************************/

struct Test1b {
  Test1b();
  virtual void foo();
  virtual void bar();
};

// 'bar' becomes the key function when 'foo' is defined inline.
inline void Test1b::foo() {}

// V-table should be defined externally.
Test1b::Test1b() { use(typeid(Test1b)); }
// CHECK: @@_ZTV6Test1b = external unnamed_addr constant 
// CHECK: @@_ZTI6Test1b = external constant

/*** Test2a ******************************************************************/

struct Test2a {
  Test2a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined with strong linkage.
Test2a::Test2a() { use(typeid(Test2a)); }
// CHECK:      @@_ZTV6Test2a = unnamed_addr constant
// CHECK-LATE: @@_ZTS6Test2a = constant
// CHECK-LATE: @@_ZTI6Test2a = constant

// 'bar' becomes the key function when 'foo' is defined inline.
void Test2a::bar() {}
inline void Test2a::foo() {}

/*** Test2b ******************************************************************/

struct Test2b {
  Test2b();
  virtual void foo();
  virtual void bar();
};

// 'bar' becomes the key function when 'foo' is defined inline.
void Test2b::bar() {}

// V-table should be defined with strong linkage.
Test2b::Test2b() { use(typeid(Test2b)); }
// CHECK:      @@_ZTV6Test2b = unnamed_addr constant
// CHECK-LATE: @@_ZTS6Test2b = constant
// CHECK-LATE: @@_ZTI6Test2b = constant

inline void Test2b::foo() {}

/*** Test2c ******************************************************************/

struct Test2c {
  Test2c();
  virtual void foo();
  virtual void bar();
};

// 'bar' becomes the key function when 'foo' is defined inline.
void Test2c::bar() {}
inline void Test2c::foo() {}

// V-table should be defined with strong linkage.
Test2c::Test2c() { use(typeid(Test2c)); }
// CHECK: @@_ZTV6Test2c = unnamed_addr constant
// CHECK: @@_ZTS6Test2c = constant
// CHECK: @@_ZTI6Test2c = constant

/*** Test3a ******************************************************************/

struct Test3a {
  Test3a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined with weak linkage.
Test3a::Test3a() { use(typeid(Test3a)); }
// 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 Test3a::bar() {}
inline void Test3a::foo() {}

/*** Test3b ******************************************************************/

struct Test3b {
  Test3b();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
inline void Test3b::bar() {}

// V-table should be defined with weak linkage.
Test3b::Test3b() { use(typeid(Test3b)); }
// CHECK:      @@_ZTV6Test3b = linkonce_odr unnamed_addr constant
// CHECK-LATE: @@_ZTS6Test3b = linkonce_odr constant
// CHECK-LATE: @@_ZTI6Test3b = linkonce_odr constant

inline void Test3b::foo() {}

/*** Test3c ******************************************************************/

struct Test3c {
  Test3c();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
inline void Test3c::bar() {}
inline void Test3c::foo() {}

// V-table should be defined with weak linkage.
Test3c::Test3c() { use(typeid(Test3c)); }
// CHECK: @@_ZTV6Test3c = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test3c = linkonce_odr constant
// CHECK: @@_ZTI6Test3c = linkonce_odr constant

/*** Test4a ******************************************************************/

template <class T> struct Test4a {
  Test4a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined with weak linkage.
template <> Test4a<int>::Test4a() { use(typeid(Test4a)); }
// 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.
template <> inline void Test4a<int>::bar() {}
template <> inline void Test4a<int>::foo() {}

/*** Test4b ******************************************************************/

template <class T> struct Test4b {
  Test4b();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test4b<int>::bar() {}

// V-table should be defined with weak linkage.
template <> Test4b<int>::Test4b() { use(typeid(Test4b)); }
// CHECK: @@_ZTV6Test4bIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test4bIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test4bIiE = linkonce_odr constant

template <> inline void Test4b<int>::foo() {}

/*** Test4c ******************************************************************/

template <class T> struct Test4c {
  Test4c();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test4c<int>::bar() {}
template <> inline void Test4c<int>::foo() {}

// V-table should be defined with weak linkage.
template <> Test4c<int>::Test4c() { use(typeid(Test4c)); }
// CHECK: @@_ZTV6Test4cIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test4cIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test4cIiE = linkonce_odr constant

/*** Test5a ******************************************************************/

template <class T> struct Test5a {
  Test5a();
  virtual void foo();
  virtual void bar();
};

template <> inline void Test5a<int>::bar();
template <> inline void Test5a<int>::foo();

// V-table should be defined with weak linkage.
template <> Test5a<int>::Test5a() { use(typeid(Test5a)); }
// 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.
template <> inline void Test5a<int>::bar() {}
template <> inline void Test5a<int>::foo() {}

/*** Test5b ******************************************************************/

template <class T> struct Test5b {
  Test5b();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test5a<int>::bar();
template <> inline void Test5b<int>::bar() {}

// V-table should be defined with weak linkage.
template <> Test5b<int>::Test5b() { use(typeid(Test5b)); }
// CHECK: @@_ZTV6Test5bIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test5bIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test5bIiE = linkonce_odr constant

template <> inline void Test5a<int>::foo();
template <> inline void Test5b<int>::foo() {}

/*** Test5c ******************************************************************/

template <class T> struct Test5c {
  Test5c();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test5a<int>::bar();
template <> inline void Test5a<int>::foo();
template <> inline void Test5c<int>::bar() {}
template <> inline void Test5c<int>::foo() {}

// V-table should be defined with weak linkage.
template <> Test5c<int>::Test5c() { use(typeid(Test5c)); }
// CHECK: @@_ZTV6Test5cIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test5cIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test5cIiE = linkonce_odr constant
@


1.1.1.3.4.1
log
@file vtable-key-function-arm.cpp was added on branch yamt-pagecache on 2014-05-22 16:18:57 +0000
@
text
@d1 307
@


1.1.1.3.4.2
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@a0 307
// 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 v-table first.
// The 'b' variants ask for the v-table second.
// The 'c' variants ask for the v-table 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.

namespace std { class type_info; }
extern void use(const std::type_info &rtti);

/*** Test0a ******************************************************************/

struct Test0a {
  Test0a();
  virtual inline void foo();
  virtual void bar();
};

// V-table should be defined externally.
Test0a::Test0a() { use(typeid(Test0a)); }
// CHECK: @@_ZTV6Test0a = external unnamed_addr constant 
// CHECK: @@_ZTI6Test0a = external constant

// This is still not a key function.
void Test0a::foo() {}

/*** Test0b ******************************************************************/

struct Test0b {
  Test0b();
  virtual inline void foo();
  virtual void bar();
};

// This is still not a key function.
void Test0b::foo() {}

// V-table should be defined externally.
Test0b::Test0b() { use(typeid(Test0b)); }
// CHECK: @@_ZTV6Test0b = external unnamed_addr constant 
// CHECK: @@_ZTI6Test0b = external constant

/*** Test1a ******************************************************************/

struct Test1a {
  Test1a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined externally.
Test1a::Test1a() { use(typeid(Test1a)); }
// CHECK: @@_ZTV6Test1a = external unnamed_addr constant 
// CHECK: @@_ZTI6Test1a = external constant

// 'bar' becomes the key function when 'foo' is defined inline.
inline void Test1a::foo() {}

/*** Test1b ******************************************************************/

struct Test1b {
  Test1b();
  virtual void foo();
  virtual void bar();
};

// 'bar' becomes the key function when 'foo' is defined inline.
inline void Test1b::foo() {}

// V-table should be defined externally.
Test1b::Test1b() { use(typeid(Test1b)); }
// CHECK: @@_ZTV6Test1b = external unnamed_addr constant 
// CHECK: @@_ZTI6Test1b = external constant

/*** Test2a ******************************************************************/

struct Test2a {
  Test2a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined with strong linkage.
Test2a::Test2a() { use(typeid(Test2a)); }
// CHECK:      @@_ZTV6Test2a = unnamed_addr constant
// CHECK-LATE: @@_ZTS6Test2a = constant
// CHECK-LATE: @@_ZTI6Test2a = constant

// 'bar' becomes the key function when 'foo' is defined inline.
void Test2a::bar() {}
inline void Test2a::foo() {}

/*** Test2b ******************************************************************/

struct Test2b {
  Test2b();
  virtual void foo();
  virtual void bar();
};

// 'bar' becomes the key function when 'foo' is defined inline.
void Test2b::bar() {}

// V-table should be defined with strong linkage.
Test2b::Test2b() { use(typeid(Test2b)); }
// CHECK:      @@_ZTV6Test2b = unnamed_addr constant
// CHECK-LATE: @@_ZTS6Test2b = constant
// CHECK-LATE: @@_ZTI6Test2b = constant

inline void Test2b::foo() {}

/*** Test2c ******************************************************************/

struct Test2c {
  Test2c();
  virtual void foo();
  virtual void bar();
};

// 'bar' becomes the key function when 'foo' is defined inline.
void Test2c::bar() {}
inline void Test2c::foo() {}

// V-table should be defined with strong linkage.
Test2c::Test2c() { use(typeid(Test2c)); }
// CHECK: @@_ZTV6Test2c = unnamed_addr constant
// CHECK: @@_ZTS6Test2c = constant
// CHECK: @@_ZTI6Test2c = constant

/*** Test3a ******************************************************************/

struct Test3a {
  Test3a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined with weak linkage.
Test3a::Test3a() { use(typeid(Test3a)); }
// 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 Test3a::bar() {}
inline void Test3a::foo() {}

/*** Test3b ******************************************************************/

struct Test3b {
  Test3b();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
inline void Test3b::bar() {}

// V-table should be defined with weak linkage.
Test3b::Test3b() { use(typeid(Test3b)); }
// CHECK:      @@_ZTV6Test3b = linkonce_odr unnamed_addr constant
// CHECK-LATE: @@_ZTS6Test3b = linkonce_odr constant
// CHECK-LATE: @@_ZTI6Test3b = linkonce_odr constant

inline void Test3b::foo() {}

/*** Test3c ******************************************************************/

struct Test3c {
  Test3c();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
inline void Test3c::bar() {}
inline void Test3c::foo() {}

// V-table should be defined with weak linkage.
Test3c::Test3c() { use(typeid(Test3c)); }
// CHECK: @@_ZTV6Test3c = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test3c = linkonce_odr constant
// CHECK: @@_ZTI6Test3c = linkonce_odr constant

/*** Test4a ******************************************************************/

template <class T> struct Test4a {
  Test4a();
  virtual void foo();
  virtual void bar();
};

// V-table should be defined with weak linkage.
template <> Test4a<int>::Test4a() { use(typeid(Test4a)); }
// 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.
template <> inline void Test4a<int>::bar() {}
template <> inline void Test4a<int>::foo() {}

/*** Test4b ******************************************************************/

template <class T> struct Test4b {
  Test4b();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test4b<int>::bar() {}

// V-table should be defined with weak linkage.
template <> Test4b<int>::Test4b() { use(typeid(Test4b)); }
// CHECK: @@_ZTV6Test4bIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test4bIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test4bIiE = linkonce_odr constant

template <> inline void Test4b<int>::foo() {}

/*** Test4c ******************************************************************/

template <class T> struct Test4c {
  Test4c();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test4c<int>::bar() {}
template <> inline void Test4c<int>::foo() {}

// V-table should be defined with weak linkage.
template <> Test4c<int>::Test4c() { use(typeid(Test4c)); }
// CHECK: @@_ZTV6Test4cIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test4cIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test4cIiE = linkonce_odr constant

/*** Test5a ******************************************************************/

template <class T> struct Test5a {
  Test5a();
  virtual void foo();
  virtual void bar();
};

template <> inline void Test5a<int>::bar();
template <> inline void Test5a<int>::foo();

// V-table should be defined with weak linkage.
template <> Test5a<int>::Test5a() { use(typeid(Test5a)); }
// 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.
template <> inline void Test5a<int>::bar() {}
template <> inline void Test5a<int>::foo() {}

/*** Test5b ******************************************************************/

template <class T> struct Test5b {
  Test5b();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test5a<int>::bar();
template <> inline void Test5b<int>::bar() {}

// V-table should be defined with weak linkage.
template <> Test5b<int>::Test5b() { use(typeid(Test5b)); }
// CHECK: @@_ZTV6Test5bIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test5bIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test5bIiE = linkonce_odr constant

template <> inline void Test5a<int>::foo();
template <> inline void Test5b<int>::foo() {}

/*** Test5c ******************************************************************/

template <class T> struct Test5c {
  Test5c();
  virtual void foo();
  virtual void bar();
};

// There ceases to be a key function after these declarations.
template <> inline void Test5a<int>::bar();
template <> inline void Test5a<int>::foo();
template <> inline void Test5c<int>::bar() {}
template <> inline void Test5c<int>::foo() {}

// V-table should be defined with weak linkage.
template <> Test5c<int>::Test5c() { use(typeid(Test5c)); }
// CHECK: @@_ZTV6Test5cIiE = linkonce_odr unnamed_addr constant
// CHECK: @@_ZTS6Test5cIiE = linkonce_odr constant
// CHECK: @@_ZTI6Test5cIiE = linkonce_odr constant
@


