45 lines · c
1// -no_deduplicate is only present from ld64 version 262 and later.2// RUN: %clang -target x86_64-apple-darwin10 -### %s \3// RUN: -mlinker-version=261 -O0 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s4 5// Add -no_deduplicate when either -O0 or -O1 is explicitly specified6// RUN: %clang -target x86_64-apple-darwin10 -### %s \7// RUN: -mlinker-version=262 -O0 2>&1 | FileCheck -check-prefix=LINK_NODEDUP %s8// RUN: %clang -target x86_64-apple-darwin10 -### %s \9// RUN: -mlinker-version=262 -O1 2>&1 | FileCheck -check-prefix=LINK_NODEDUP %s10 11// RUN: %clang -target x86_64-apple-darwin10 -### %s \12// RUN: -mlinker-version=262 -O2 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s13// RUN: %clang -target x86_64-apple-darwin10 -### %s \14// RUN: -mlinker-version=262 -O3 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s15// RUN: %clang -target x86_64-apple-darwin10 -### %s \16// RUN: -mlinker-version=262 -Os 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s17// RUN: %clang -target x86_64-apple-darwin10 -### %s \18// RUN: -mlinker-version=262 -O4 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s19// RUN: %clang -target x86_64-apple-darwin10 -### %s \20// RUN: -mlinker-version=262 -Ofast 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s21 22// Add -no_deduplicate when no -O option is specified *and* this is a compile+link23// (implicit -O0)24// RUN: %clang -target x86_64-apple-darwin10 -### %s \25// RUN: -mlinker-version=262 2>&1 | FileCheck -check-prefix=LINK_NODEDUP %s26 27// Do *not* add -no_deduplicate when no -O option is specified and this is just a link28// (since we can't imply -O0)29// RUN: rm -f %t.o %t.bin30// RUN: yaml2obj %S/Inputs/empty-x86_64-apple-darwin.yaml -o %t.o31// RUN: %clang -target x86_64-apple-darwin10 %t.o -### -mlinker-version=262 \32// RUN: -o %t.bin 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s33// RUN: %clang -target x86_64-apple-darwin10 %t.o -### -mlinker-version=262 \34// RUN: -O0 -o %t.bin 2>&1 | FileCheck -check-prefix=LINK_NODEDUP %s35// RUN: %clang -target x86_64-apple-darwin10 %t.o -### -mlinker-version=262 \36// RUN: -O1 -o %t.bin 2>&1 | FileCheck -check-prefix=LINK_NODEDUP %s37// RUN: %clang -target x86_64-apple-darwin10 %t.o -### -mlinker-version=262 \38// RUN: -O2 -o %t.bin 2>&1 | FileCheck -check-prefix=LINK_DEDUP %s39 40// LINK_NODEDUP: {{ld(.exe)?"}}41// LINK_NODEDUP: "-no_deduplicate"42 43// LINK_DEDUP: {{ld(.exe)?"}}44// LINK_DEDUP-NOT: "-no_deduplicate"45