
musttail is not often possible to be generated on PPC targets as when calling to a function defined in another module, PPC needs to restore the TOC pointer. To restore the TOC pointer, compiler needs to emit a nop after the call to let linker generate codes to restore TOC pointer. Tail call cannot generate expected call sequence for this case. To avoid the crash inside the compiler backend, a diagnosis is added in the frontend. Fixes #63214
14 lines
690 B
C
14 lines
690 B
C
// RUN: %clang_cc1 %s -triple powerpc64-ibm-aix-xcoff -o /dev/null -emit-llvm -verify=aix
|
|
// RUN: %clang_cc1 %s -triple powerpc-ibm-aix-xcoff -o /dev/null -emit-llvm -verify=aix
|
|
// RUN: %clang_cc1 %s -triple powerpc64-unknown-linux-gnu -o /dev/null -emit-llvm -verify=linux
|
|
// RUN: %clang_cc1 %s -triple powerpc64le-unknown-linux-gnu -o /dev/null -emit-llvm -verify=linux
|
|
|
|
__attribute__((weak)) int func2(int i) {
|
|
return 0;
|
|
}
|
|
int external_call2(int i) {
|
|
// linux-error@+2 {{'musttail' attribute for this call is impossible because external calls can not be tail called on PPC}}
|
|
// aix-error@+1 {{'musttail' attribute is not supported on AIX}}
|
|
[[clang::musttail]] return func2(i);
|
|
}
|