1 // RUN: %clang -target x86_64-linux-gnu -fsplit-stack -S -std=c++11 %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-SEGSTK %s 2 // RUN: %clang -target x86_64-linux-gnu -S -std=c++11 %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-NOSEGSTK %s 3 4 int foo() { 5 return 0; 6 } 7 8 template <typename T> 9 [[gnu::no_split_stack]] 10 int tnosplit() { 11 return 0; 12 } 13 14 [[gnu::no_split_stack]] 15 int nosplit() { 16 return tnosplit<int>(); 17 } 18 19 // CHECK-SEGSTK: define i32 @_Z3foov() [[SS:#[0-9]+]] { 20 // CHECK-SEGSTK: define i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] { 21 // CHECK-SEGSTK: define linkonce_odr i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] comdat { 22 // CHECK-SEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} } 23 // CHECK-SEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} } 24 // CHECK-SEGSTK: [[SS]] = { {{.*}} "split-stack" {{.*}} } 25 // CHECK-SEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} } 26 // CHECK-SEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} } 27 28 // CHECK-NOSEGSTK: define i32 @_Z3foov() [[NSS0:#[0-9]+]] { 29 // CHECK-NOSEGSTK: define i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] { 30 // CHECK-NOSEGSTK: define linkonce_odr i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] comdat { 31 // CHECK-NOSEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} } 32 // CHECK-NOSEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} } 33 // CHECK-NOSEGSTK-NOT: [[NSS3]] = { {{.*}} "split-stack" {{.*}} } 34