Index: compiler-rt/lib/profile/InstrProfilingPlatformLinux.c =================================================================== --- compiler-rt/lib/profile/InstrProfilingPlatformLinux.c +++ compiler-rt/lib/profile/InstrProfilingPlatformLinux.c @@ -263,7 +263,7 @@ // Ideally, we create a ".ref" of each variable inside the function // __llvm_profile_begin_counters(), but there's no source level construct // that allows us to generate that. -__attribute__((destructor)) void keep() { +COMPILER_RT_VISIBILITY __attribute__((destructor)) void keep() { int volatile use = &dummy_cnts < &dummy_data && &dummy_name < &dummy_vnds; (void)use; } Index: compiler-rt/test/profile/AIX/lit.local.cfg.py =================================================================== --- /dev/null +++ compiler-rt/test/profile/AIX/lit.local.cfg.py @@ -0,0 +1,9 @@ +def getRoot(config): + if not config.parent: + return config + return getRoot(config.parent) + +root = getRoot(config) + +if root.host_os not in ['AIX']: + config.unsupported = True Index: compiler-rt/test/profile/AIX/shared-bexpall-pgo.c =================================================================== --- /dev/null +++ compiler-rt/test/profile/AIX/shared-bexpall-pgo.c @@ -0,0 +1,14 @@ +// RUN: split-file %s %t +// RUN: cd %t +// +// RUN: %clang -fprofile-generate foo.c -c -o foo.o +// RUN: %clang -shared foo.o -fprofile-generate -o libfoo.so -bexpall +// RUN: %clang -L%t user.c libfoo.so -fprofile-generate -o user1 +// RUN: ./user1 + +//--- foo.c +void foo() {} + +//--- user.c +void foo(); +int main() { foo(); }