
This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with `black`. If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run git checkout --ours <yourfile> and then reformat it with black. If you run into any problems, post to discourse about it and we will try to help. RFC Thread below: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Reviewed By: MatzeB Differential Revision: https://reviews.llvm.org/D150761
31 lines
554 B
Python
Executable File
31 lines
554 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from __future__ import absolute_import, division, print_function
|
|
|
|
|
|
def pcall(f, N):
|
|
if N == 0:
|
|
print(" f(0)", file=f)
|
|
return
|
|
|
|
print(" f(", file=f)
|
|
pcall(f, N - 1)
|
|
print(" )", file=f)
|
|
|
|
|
|
def main():
|
|
f = open("t.c", "w")
|
|
print("int f(int n) { return n; }", file=f)
|
|
print("int t() {", file=f)
|
|
print(" return", file=f)
|
|
pcall(f, 10000)
|
|
print(" ;", file=f)
|
|
print("}", file=f)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import sys
|
|
|
|
sys.setrecursionlimit(100000)
|
|
main()
|