Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / ios_commands / iossim_compile.py
blob39b211b093c92d4b5d53053a061bf8dbabba0a1b
1 #!/usr/bin/env python3
3 import os, sys, subprocess
5 output = None
6 output_type = "executable"
8 args = sys.argv[1:]
9 while args:
10 arg = args.pop(0)
11 if arg == "-shared":
12 output_type = "shared"
13 elif arg == "-dynamiclib":
14 output_type = "dylib"
15 elif arg == "-c":
16 output_type = "object"
17 elif arg == "-S":
18 output_type = "assembly"
19 elif arg == "-o":
20 output = args.pop(0)
22 if output == None:
23 print("No output file name!")
24 sys.exit(1)
26 ret = subprocess.call(sys.argv[1:])
27 if ret != 0:
28 sys.exit(ret)
30 # If we produce a dylib, ad-hoc sign it.
31 if output_type in ["shared", "dylib"]:
32 ret = subprocess.call(["codesign", "-s", "-", output])