2014-05-20 06:14:34 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsplit-stack -S -std=c++11 %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-SEGSTK %s
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -S -std=c++11 %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-NOSEGSTK %s
|
|
|
|
|
|
|
|
int foo() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
[[gnu::no_split_stack]]
|
|
|
|
int tnosplit() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[[gnu::no_split_stack]]
|
|
|
|
int nosplit() {
|
|
|
|
return tnosplit<int>();
|
|
|
|
}
|
|
|
|
|
2021-10-18 22:03:47 +08:00
|
|
|
// CHECK-SEGSTK: define dso_local i32 @_Z3foov() [[SS:#[0-9]+]] {
|
|
|
|
// CHECK-SEGSTK: define dso_local i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] {
|
|
|
|
// CHECK-SEGSTK: define linkonce_odr dso_local i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] comdat {
|
2014-05-20 06:14:34 +08:00
|
|
|
// CHECK-SEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} }
|
|
|
|
// CHECK-SEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} }
|
|
|
|
// CHECK-SEGSTK: [[SS]] = { {{.*}} "split-stack" {{.*}} }
|
|
|
|
// CHECK-SEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} }
|
|
|
|
// CHECK-SEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} }
|
|
|
|
|
2021-10-18 22:03:47 +08:00
|
|
|
// CHECK-NOSEGSTK: define dso_local i32 @_Z3foov() [[NSS0:#[0-9]+]] {
|
|
|
|
// CHECK-NOSEGSTK: define dso_local i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] {
|
|
|
|
// CHECK-NOSEGSTK: define linkonce_odr dso_local i32 @_Z8tnosplitIiEiv() [[NSS0]] comdat {
|
2021-04-03 18:49:50 +08:00
|
|
|
// CHECK-NOSEGSTK-NOT: [[NSS0]] = { {{.*}} "split-stack" {{.*}} }
|
2014-05-20 06:14:34 +08:00
|
|
|
// CHECK-NOSEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} }
|