summaryrefslogtreecommitdiff
path: root/test/mach-o/stack-size.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'test/mach-o/stack-size.yaml')
-rw-r--r--test/mach-o/stack-size.yaml24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/mach-o/stack-size.yaml b/test/mach-o/stack-size.yaml
new file mode 100644
index 000000000000..0e8edb2b5498
--- /dev/null
+++ b/test/mach-o/stack-size.yaml
@@ -0,0 +1,24 @@
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t %p/Inputs/libSystem.yaml
+# RUN: llvm-objdump -private-headers %t | FileCheck --check-prefix=CHECK-DEFAULT %s
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t -stack_size 31415926000 %p/Inputs/libSystem.yaml
+# RUN: llvm-objdump -private-headers %t | FileCheck --check-prefix=CHECK-EXPLICIT %s
+# RUN: not lld -flavor darwin -arch x86_64 -stack_size 0x31415926530 %s >/dev/null 2> %t
+# RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-MISPAGED
+# RUN: not lld -flavor darwin -arch x86_64 -stack_size hithere %s >/dev/null 2> %t
+# RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-NOTHEX
+
+--- !native
+defined-atoms:
+ - name: _main
+ scope: global
+ content: []
+
+# CHECK-DEFAULT: cmd LC_MAIN
+# CHECK-DEFAULT: stacksize 0
+
+# CHECK-EXPLICIT: cmd LC_MAIN
+# CHECK-EXPLICIT: stacksize 3384796143616
+
+# CHECK-ERROR-MISPAGED: error: stack_size must be a multiple of page size (0x1000)
+
+# CHECK-ERROR-NOTHEX: error: stack_size expects a hex number