phunix/external/bsd/llvm/dist/clang/test/CodeGenCXX/internal-linkage.cpp
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

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