//------------------------------------------------------------------------------ // CLING - the C++ LLVM-based InterpreterG :) // // This file is dual-licensed: you can choose to license it under the University // of Illinois Open Source License or the GNU Lesser General Public License. See // LICENSE.TXT for details. //------------------------------------------------------------------------------ // RUN: clang -shared -fPIC -DBUILD_SHARED %s -o%T/libSymbols%shlibext // RUN: %cling --nologo -L%T -lSymbols %s | FileCheck %s // Check that weak symbols do not get re-emitted (ROOT-6124) extern "C" int printf(const char*,...); template struct StaticStuff { static T s_data; }; template T StaticStuff::s_data = 42; int compareAddr(int* interp); #ifdef BUILD_SHARED int compareAddr(int* interp) { if (interp != &StaticStuff::s_data) { printf("Wrong address, %ld in shared lib, %ld in interpreter!\n", (long)&StaticStuff::s_data, (long)interp); // CHECK-NOT: Wrong address return 1; } return 0; } #else int Symbols() { return compareAddr(&StaticStuff::s_data); } #endif