diff options
author | Manman Ren <manman.ren@gmail.com> | 2016-03-18 23:41:51 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2016-03-18 23:41:51 +0000 |
commit | 4865d89653f36cc16daffdbdec37629b88bb2d54 (patch) | |
tree | 32e140c2d6b619ee06a420be39a4588f5854bf8a /llvm/test/CodeGen | |
parent | 2828c57b6f40a6d8a42ea6b72aedf39e58325764 (diff) | |
download | bcm5719-llvm-4865d89653f36cc16daffdbdec37629b88bb2d54.tar.gz bcm5719-llvm-4865d89653f36cc16daffdbdec37629b88bb2d54.zip |
[CXX_FAST_TLS] Disable tail call when calling conventions are mismatched.
Since CXX_FAST_TLS has a bigger set of CSRs, we don't tail call when caller
and callee have mismatched calling conventions.
llvm-svn: 263856
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r-- | llvm/test/CodeGen/AArch64/cxx-tlscc.ll | 13 | ||||
-rw-r--r-- | llvm/test/CodeGen/ARM/cxx-tlscc.ll | 13 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/cxx_tlscc64.ll | 13 |
3 files changed, 39 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/cxx-tlscc.ll b/llvm/test/CodeGen/AArch64/cxx-tlscc.ll index 9219132d1bf..16d1d95342c 100644 --- a/llvm/test/CodeGen/AArch64/cxx-tlscc.ll +++ b/llvm/test/CodeGen/AArch64/cxx-tlscc.ll @@ -205,5 +205,18 @@ define cxx_fast_tlscc %class.C* @tls_test2() #1 { call cxx_fast_tlscc void @tls_helper() ret %class.C* @tC } + +; Make sure we do not allow tail call when caller and callee have different +; calling conventions. +declare %class.C* @_ZN1CD1Ev(%class.C* readnone returned %this) +; CHECK-LABEL: tls_test +; CHECK: bl __tlv_atexit +define cxx_fast_tlscc void @__tls_test() { +entry: + store i32 0, i32* getelementptr inbounds (%class.C, %class.C* @tC, i64 0, i32 0), align 4 + %0 = tail call i32 @_tlv_atexit(void (i8*)* bitcast (%class.C* (%class.C*)* @_ZN1CD1Ev to void (i8*)*), i8* bitcast (%class.C* @tC to i8*), i8* nonnull @__dso_handle) #1 + ret void +} + attributes #0 = { nounwind "no-frame-pointer-elim"="true" } attributes #1 = { nounwind } diff --git a/llvm/test/CodeGen/ARM/cxx-tlscc.ll b/llvm/test/CodeGen/ARM/cxx-tlscc.ll index e8e3b6d1973..4005db3a435 100644 --- a/llvm/test/CodeGen/ARM/cxx-tlscc.ll +++ b/llvm/test/CodeGen/ARM/cxx-tlscc.ll @@ -101,5 +101,18 @@ define cxx_fast_tlscc %class.C* @tls_test2() #1 { call cxx_fast_tlscc void @tls_helper() ret %class.C* @tC } + +; Make sure we do not allow tail call when caller and callee have different +; calling conventions. +declare %class.C* @_ZN1CD1Ev(%class.C* readnone returned %this) +; CHECK-LABEL: tls_test +; CHECK: bl __tlv_atexit +define cxx_fast_tlscc void @__tls_test() { +entry: + store i32 0, i32* getelementptr inbounds (%class.C, %class.C* @tC, i64 0, i32 0), align 4 + %0 = tail call i32 @_tlv_atexit(void (i8*)* bitcast (%class.C* (%class.C*)* @_ZN1CD1Ev to void (i8*)*), i8* bitcast (%class.C* @tC to i8*), i8* nonnull @__dso_handle) #1 + ret void +} + attributes #0 = { nounwind "no-frame-pointer-elim"="true" } attributes #1 = { nounwind } diff --git a/llvm/test/CodeGen/X86/cxx_tlscc64.ll b/llvm/test/CodeGen/X86/cxx_tlscc64.ll index 149384549e9..c9be4a269c0 100644 --- a/llvm/test/CodeGen/X86/cxx_tlscc64.ll +++ b/llvm/test/CodeGen/X86/cxx_tlscc64.ll @@ -138,5 +138,18 @@ define cxx_fast_tlscc %class.C* @tls_test2() #1 { call cxx_fast_tlscc void @tls_helper() ret %class.C* @tC } + +; Make sure we do not allow tail call when caller and callee have different +; calling conventions. +declare %class.C* @_ZN1CD1Ev(%class.C* readnone returned %this) +; CHECK-LABEL: tls_test +; CHECK: callq {{.*}}tlv_atexit +define cxx_fast_tlscc void @tls_test() { +entry: + store i32 0, i32* getelementptr inbounds (%class.C, %class.C* @tC, i64 0, i32 0), align 4 + %0 = tail call i32 @_tlv_atexit(void (i8*)* bitcast (%class.C* (%class.C*)* @_ZN1CD1Ev to void (i8*)*), i8* bitcast (%class.C* @tC to i8*), i8* nonnull @__dso_handle) #1 + ret void +} + attributes #0 = { nounwind "no-frame-pointer-elim"="true" } attributes #1 = { nounwind } |