llvm-project/clang/test/CodeGen/windows-on-arm-stack-probe-size.c
Saleem Abdulrasool 71d1dd1e0c CodeGen: create a WindowsARMTargetCodeGenInfo
Create a new TargetCodeGenInfo for Windows on ARM to permit annotating the
functions with stack-probe-size (for /Gs and -mstack-probe-support) for
generating the stack probe necessary for Windows targets.  This will be used by
the backend when lowering the frame to generate the stack probe appropriately.

llvm-svn: 227641
2015-01-30 23:29:19 +00:00

29 lines
890 B
C

// RUN: %clang_cc1 -triple thumbv7-windows-itanium -mstack-probe-size=8096 -O2 -emit-llvm %s -o - \
// RUN: | FileCheck %s -check-prefix CHECK-8096
// RUN: %clang_cc1 -triple thumbv7-windows-itanium -mstack-probe-size=4096 -O2 -emit-llvm %s -o - \
// RUN: | FileCheck %s -check-prefix CHECK-4096
// RUN: %clang_cc1 -triple thumbv7-windows-itanium -O2 -emit-llvm %s -o - \
// RUN: | FileCheck %s -check-prefix CHECK
__declspec(dllimport) void initialise(signed char buffer[4096]);
__declspec(dllexport) signed char function(unsigned index) {
signed char buffer[4096];
initialise(buffer);
return buffer[index];
}
// CHECK-8096: attributes #0 = {
// CHECK-8096: "stack-probe-size"="8096"
// CHECK-8096: }
// CHECK-4096: attributes #0 = {
// CHECK-4096-NOT: "stack-probe-size"=
// CHECK-4096: }
// CHECK: attributes #0 = {
// CHECK-NOT: "stack-probe-size"=
// CHECK: }