[AMDGPU] Add True16 register classes.
[llvm-project.git] / llvm / test / Support / interrupts.test
blob86730f5139c042db961a342ab6a3b5b48d8c346f
1 ## Show that SIGINT and similar signals don't cause crash messages to be
2 ## reported.
3 # RUN: %python %s wrapper llvm-symbolizer 2> %t.err
4 # RUN: count 0 < %t.err
6 import os
7 import signal
8 import subprocess
9 import sys
10 import time
12 def run_symbolizer():
13     proc = subprocess.Popen([sys.argv[2]], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
14     # Write then read some output to ensure the process has started fully.
15     proc.stdin.write(b'foo bar\n')
16     proc.stdin.flush()
17     proc.stdout.readline()
18     # Windows handles signals differently.
19     if os.name == 'nt':
20         os.kill(0, signal.CTRL_BREAK_EVENT)
21     else:
22         proc.send_signal(signal.SIGINT)
24 # On Windows, this function spawns the subprocess in its own (hidden) console,
25 # so that signals do not interfere with the calling test. This isn't necessary
26 # on other systems.
27 def run_wrapper():
28     args = [sys.executable, __file__, 'symbolizer'] + sys.argv[2:]
29     if os.name == 'nt':
30         startupinfo = subprocess.STARTUPINFO()
31         startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
32         proc = subprocess.Popen(args,
33                                 stderr=sys.stderr,
34                                 startupinfo=startupinfo,
35                                 creationflags=subprocess.CREATE_NEW_CONSOLE)
36     else:
37         proc = subprocess.Popen(args,
38                                 stderr=subprocess.PIPE)
40 if sys.argv[1] == 'wrapper':
41     run_wrapper()
42 else:
43     run_symbolizer()