This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
65 lines
1.4 KiB
C++
65 lines
1.4 KiB
C++
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
|
|
|
|
struct Global { Global(); };
|
|
template<typename T> struct X { X() {} };
|
|
|
|
|
|
namespace {
|
|
struct Anon { Anon() {} };
|
|
|
|
// CHECK: @_ZN12_GLOBAL__N_15anon0E = internal global
|
|
Global anon0;
|
|
}
|
|
|
|
// CHECK: @anon1 = internal global
|
|
Anon anon1;
|
|
|
|
// CHECK: @anon2 = internal global
|
|
X<Anon> anon2;
|
|
|
|
// rdar: // 8071804
|
|
char const * const xyzzy = "Hello, world!";
|
|
extern char const * const xyzzy;
|
|
|
|
char const * const *test1()
|
|
{
|
|
// CHECK: @_ZL5xyzzy = internal constant
|
|
return &xyzzy;
|
|
}
|
|
|
|
static char const * const static_xyzzy = "Hello, world!";
|
|
extern char const * const static_xyzzy;
|
|
|
|
char const * const *test2()
|
|
{
|
|
// CHECK: @_ZL12static_xyzzy = internal constant
|
|
return &static_xyzzy;
|
|
}
|
|
|
|
static char const * static_nonconst_xyzzy = "Hello, world!";
|
|
extern char const * static_nonconst_xyzzy;
|
|
|
|
char const * *test3()
|
|
{
|
|
// CHECK: @_ZL21static_nonconst_xyzzy = internal global
|
|
return &static_nonconst_xyzzy;
|
|
}
|
|
|
|
|
|
char const * extern_nonconst_xyzzy = "Hello, world!";
|
|
extern char const * extern_nonconst_xyzzy;
|
|
|
|
char const * *test4()
|
|
{
|
|
// CHECK: @extern_nonconst_xyzzy = global
|
|
return &extern_nonconst_xyzzy;
|
|
}
|
|
|
|
// PR10120
|
|
template <typename T> class klass {
|
|
virtual void f();
|
|
};
|
|
namespace { struct S; }
|
|
void foo () { klass<S> x; }
|
|
// CHECK: @_ZTV5klassIN12_GLOBAL__N_11SEE = internal unnamed_addr constant
|