File: darwin-ld-dedup.c

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (46 lines) | stat: -rw-r--r-- 2,417 bytes parent folder | download | duplicates (10)
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
// REQUIRES: system-darwin

// -no_deduplicate is only present from ld64 version 262 and later.
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
// RUN:   -mlinker-version=261 -O0 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s

// Add -no_deduplicate when either -O0 or -O1 is explicitly specified
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
// RUN:   -mlinker-version=262 -O0 2>&1 | FileCheck -check-prefix=LINK_NODEDUP %s
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
// RUN:   -mlinker-version=262 -O1 2>&1 | FileCheck -check-prefix=LINK_NODEDUP %s

// RUN: %clang -target x86_64-apple-darwin10 -### %s \
// RUN:   -mlinker-version=262 -O2 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
// RUN:   -mlinker-version=262 -O3 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
// RUN:   -mlinker-version=262 -Os 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
// RUN:   -mlinker-version=262 -O4 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
// RUN:   -mlinker-version=262 -Ofast 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s

// Add -no_deduplicate when no -O option is specified *and* this is a compile+link
// (implicit -O0)
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
// RUN:   -mlinker-version=262 2>&1 | FileCheck -check-prefix=LINK_NODEDUP %s

// Do *not* add -no_deduplicate when no -O option is specified and this is just a link
// (since we can't imply -O0)
// RUN: rm -f %t.o %t.bin
// RUN: %clang -target x86_64-apple-darwin10 -c -o %t.o %s
// RUN: %clang -target x86_64-apple-darwin10 %t.o -### -mlinker-version=262 \
// RUN:   -o %t.bin 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s
// RUN: %clang -target x86_64-apple-darwin10 %t.o -### -mlinker-version=262 \
// RUN:   -O0 -o %t.bin 2>&1 | FileCheck -check-prefix=LINK_NODEDUP %s
// RUN: %clang -target x86_64-apple-darwin10 %t.o -### -mlinker-version=262 \
// RUN:   -O1 -o %t.bin 2>&1 | FileCheck -check-prefix=LINK_NODEDUP %s
// RUN: %clang -target x86_64-apple-darwin10 %t.o -### -mlinker-version=262 \
// RUN:   -O2 -o %t.bin 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s

// LINK_NODEDUP: {{ld(.exe)?"}}
// LINK_NODEDUP: "-no_deduplicate"

// LINK_DEDUP: {{ld(.exe)?"}}
// LINK_DEDUP-NOT: "-no_deduplicate"