1 // Check that we split debug output properly
2 //
3 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
4 // RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
5 //
6 // CHECK-ACTIONS: "-split-dwarf-file" "split-debug.dwo" "-split-dwarf-output" "split-debug.dwo"
7 
8 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
9 // RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
10 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -c -### %s 2> %t
11 // RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
12 
13 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### %s 2> %t
14 // RUN: FileCheck -check-prefix=CHECK-ACTIONS-SINGLE-SPLIT < %t %s
15 //
16 // CHECK-ACTIONS-SINGLE-SPLIT: "-split-dwarf-file" "split-debug.o"
17 // CHECK-ACTIONS-SINGLE-SPLIT-NOT: "-split-dwarf-output"
18 
19 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### -o %tfoo.o %s 2> %t
20 // RUN: FileCheck -check-prefix=CHECK-SINGLE-SPLIT-FILENAME < %t %s
21 //
22 // CHECK-SINGLE-SPLIT-FILENAME: "-split-dwarf-file" "{{.*}}foo.o"
23 // CHECK-SINGLE-SPLIT-FILENAME-NOT: "-split-dwarf-output"
24 
25 // RUN: %clang -target x86_64-macosx -gsplit-dwarf -c -### %s 2> %t
26 // RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s
27 //
28 // CHECK-NO-ACTIONS-NOT: -split-dwarf
29 
30 
31 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -o Bad.x -### %s 2> %t
32 // RUN: FileCheck -check-prefix=CHECK-BAD < %t %s
33 //
34 // CHECK-BAD-NOT: "Bad.dwo"
35 
36 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
37 // RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
38 //
39 // RUN: %clang -target x86_64-pc-freebsd12 -gsplit-dwarf -c -### %s 2> %t
40 // RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
41 //
42 // RUN: %clang -target amdgcn-amd-amdhsa -gsplit-dwarf -c -### %s 2> %t
43 // RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
44 //
45 // CHECK-OPTION: "-split-dwarf-file" "split-debug.dwo" "-split-dwarf-output" "split-debug.dwo"
46 
47 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -S -### %s 2> %t
48 // RUN: FileCheck -check-prefix=CHECK-ASM < %t %s
49 //
50 // CHECK-ASM-NOT: objcopy
51 
52 // RUN: %clang -target x86_64-unknown-linux-gnu -no-integrated-as -gsplit-dwarf -c -### %s 2> %t
53 // RUN: FileCheck -check-prefix=CHECK-IAS < %t %s
54 //
55 // CHECK-IAS: objcopy
56 
57 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -fno-split-dwarf-inlining -S -### %s 2> %t
58 // RUN: FileCheck -check-prefix=CHECK-GMLT-WITH-SPLIT < %t %s
59 //
60 // CHECK-GMLT-WITH-SPLIT: "-debug-info-kind=line-tables-only"
61 // CHECK-GMLT-WITH-SPLIT: "-split-dwarf-file"
62 // CHECK-GMLT-WITH-SPLIT: "-split-dwarf-output"
63 
64 // RUN: %clang -target x86_64-unknown-linux-gnu -g -S -### %s 2> %t
65 // RUN: FileCheck -check-prefix=CHECK-NOINLINE-WITHOUT-SPLIT < %t %s
66 //
67 // RUN: %clang -target x86_64-unknown-linux-gnu -g -fno-split-dwarf-inlining -S -### %s 2> %t
68 // RUN: FileCheck -check-prefix=CHECK-NOINLINE-WITHOUT-SPLIT < %t %s
69 //
70 // CHECK-NOINLINE-WITHOUT-SPLIT: "-fno-split-dwarf-inlining"
71 // CHECK-NOINLINE-WITHOUT-SPLIT: "-debug-info-kind=constructor"
72 
73 // RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
74 // RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-GMLT < %t %s
75 //
76 // CHECK-SPLIT-WITH-GMLT: "-debug-info-kind=constructor"
77 // CHECK-SPLIT-WITH-GMLT: "-split-dwarf-output"
78 
79 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
80 // RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-NOINL < %t %s
81 //
82 // CHECK-SPLIT-WITH-NOINL: "-debug-info-kind=constructor"
83 // CHECK-SPLIT-WITH-NOINL: "-split-dwarf-output"
84 
85 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -fsplit-dwarf-inlining -S -### %s 2> %t
86 // RUN: FileCheck -check-prefix=CHECK-GMLT-OVER-SPLIT < %t %s
87 //
88 // CHECK-GMLT-OVER-SPLIT: "-debug-info-kind=line-tables-only"
89 // CHECK-GMLT-OVER-SPLIT-NOT: "-split-dwarf-file"
90 // CHECK-GMLT-OVER-SPLIT-NOT: "-split-dwarf-output"
91 
92 // RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -S -### %s 2> %t
93 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-GMLT < %t %s
94 //
95 // CHECK-SPLIT-OVER-GMLT: "-debug-info-kind=constructor"
96 // CHECK-SPLIT-OVER-GMLT: "-split-dwarf-file"
97 // CHECK-SPLIT-OVER-GMLT: "-split-dwarf-output"
98 
99 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -g0 -fno-split-dwarf-inlining -S -### %s 2> %t
100 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
101 //
102 // CHECK-G0-OVER-SPLIT-NOT: "-debug-info-kind
103 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-file"
104 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-output"
105 
106 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -g0 -S -### %s 2> %t
107 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
108 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -g0 -S -### %s 2> %t
109 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
110 //
111 // CHECK-G0-OVER-SPLIT-NOT: "-debug-info-kind
112 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-file"
113 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-output"
114 
115 // RUN: %clang -target x86_64-unknown-linux-gnu -g0 -gsplit-dwarf -S -### %s 2> %t
116 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-G0 < %t %s
117 // RUN: %clang -target x86_64-unknown-linux-gnu -g0 -gsplit-dwarf=split -S -### %s 2> %t
118 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-G0 < %t %s
119 //
120 // CHECK-SPLIT-OVER-G0: "-debug-info-kind=constructor"
121 // CHECK-SPLIT-OVER-G0: "-split-dwarf-file"
122 // CHECK-SPLIT-OVER-G0: "-split-dwarf-output"
123