File: darwin-dsymutil.c

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (71 lines) | stat: -rw-r--r-- 4,095 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Check that we run dsymutil properly with multiple -arch options.
//
// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-phases \
// RUN:   -arch i386 -arch x86_64 %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s
//
// CHECK-MULTIARCH-ACTIONS: 0: input, "{{.*}}darwin-dsymutil.c", c
// CHECK-MULTIARCH-ACTIONS: 1: preprocessor, {0}, cpp-output
// CHECK-MULTIARCH-ACTIONS: 2: compiler, {1}, ir
// CHECK-MULTIARCH-ACTIONS: 3: backend, {2}, assembler
// CHECK-MULTIARCH-ACTIONS: 4: assembler, {3}, object
// CHECK-MULTIARCH-ACTIONS: 5: linker, {4}, image
// CHECK-MULTIARCH-ACTIONS: 6: bind-arch, "i386", {5}, image
// CHECK-MULTIARCH-ACTIONS: 7: bind-arch, "x86_64", {5}, image
// CHECK-MULTIARCH-ACTIONS: 8: lipo, {6, 7}, image
// CHECK-MULTIARCH-ACTIONS: 9: dsymutil, {8}, dSYM
//
// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \
// RUN:   -arch i386 -arch x86_64 %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s
//
// CHECK-MULTIARCH-BINDINGS: "x86_64-apple-darwin11" - "darwin::Lipo", inputs: [{{.*}}, {{.*}}], output: "a.out"
// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin11" - "darwin::Dsymutil", inputs: ["a.out"], output: "a.out.dSYM"

// Check output name derivation.
//
// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \
// RUN:   -o foo %s -g 2> %t
// RUN: FileCheck -Doutfile=foo -Ddsymfile=foo.dSYM \
// RUN:          -check-prefix=CHECK-OUTPUT-NAME < %t %s
//
// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \
// RUN:   -o bar/foo %s -g 2> %t
// RUN: FileCheck -Doutfile=bar/foo -Ddsymfile=bar/foo.dSYM \
// RUN:           -check-prefix=CHECK-OUTPUT-NAME < %t %s
//
// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \
// RUN:   -o bar/foo -dsym-dir external %s -g 2> %t
// RUN: FileCheck -Doutfile=bar/foo -Ddsymfile=external/foo.dSYM \
// RUN:           -check-prefix=CHECK-OUTPUT-NAME < %t %s
//
// CHECK-OUTPUT-NAME: "x86_64-apple-darwin11" - "darwin::Linker", inputs: [{{.*}}], output: "[[outfile]]"
// CHECK-OUTPUT-NAME: "x86_64-apple-darwin11" - "darwin::Dsymutil", inputs: ["[[outfile]]"], output: "[[dsymfile]]"

// Check output name derivation for multiple -arch options.
//
// RUN: %clang -target x86_64-apple-darwin11 \
// RUN:   -arch x86_64 -arch arm64 -ccc-print-bindings %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-MULTIARCH-OUTPUT-NAME < %t %s
//
// CHECK-MULTIARCH-OUTPUT-NAME: "x86_64-apple-darwin11" - "darwin::Linker", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out"
// CHECK-MULTIARCH-OUTPUT-NAME: "arm64-apple-darwin11" - "darwin::Linker", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-arm64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out"
// CHECK-MULTIARCH-OUTPUT-NAME: "arm64-apple-darwin11" - "darwin::Lipo", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out", "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out"], output: "a.out"
//
// RUN: %clang -target x86_64-apple-darwin11 \
// RUN:   -Wl,-foo -arch x86_64 -arch arm64 -ccc-print-bindings %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG < %t %s
//
// CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG: "x86_64-apple-darwin11" - "darwin::Linker", inputs: [(input arg), "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out"
// CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG: "arm64-apple-darwin11" - "darwin::Linker", inputs: [(input arg), "{{.*}}{{/|\\}}darwin-dsymutil-arm64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out"
// CHECK-MULTIARCH-OUTPUT-NAME-WITH-ARG: "arm64-apple-darwin11" - "darwin::Lipo", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out", "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out"], output: "a.out"

// Check that we only use dsymutil when needed.
//
// RUN: touch %t.o
// RUN: %clang -target x86_64-apple-darwin11 -ccc-print-bindings \
// RUN:   -o foo %t.o -g 2> %t
// RUN: not grep "Dsymutil" %t

// Check that we don't crash when translating arguments for dsymutil.
// RUN: %clang -m32 -target x86_64-apple-darwin11 -arch x86_64 -g %s -###