# Test --allow to include one object file (1.o). RUN: dsymutil --linker classic --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --allow=%p/../Inputs/allow-disallow/one.yaml \ RUN: | FileCheck %s --check-prefix=ALLOW-ONE RUN: dsymutil --linker parallel --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --allow=%p/../Inputs/allow-disallow/one.yaml \ RUN: | FileCheck %s --check-prefix=ALLOW-ONE # Test --allow to include two object files (1.o and 3.o). RUN: dsymutil --linker classic --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --allow=%p/../Inputs/allow-disallow/two.yaml \ RUN: | FileCheck %s --check-prefix=ALLOW-TWO RUN: dsymutil --linker parallel --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --allow=%p/../Inputs/allow-disallow/two.yaml \ RUN: | FileCheck %s --check-prefix=ALLOW-TWO # Test --allow to include no object files (empty allow list). RUN: dsymutil --linker classic --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --allow=%p/../Inputs/allow-disallow/empty.yaml \ RUN: | FileCheck %s --check-prefix=ALLOW-NONE RUN: dsymutil --linker parallel --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --allow=%p/../Inputs/allow-disallow/empty.yaml \ RUN: | FileCheck %s --check-prefix=ALLOW-NONE # Test --disallow to exclude one object file (1.o). RUN: dsymutil --linker classic --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --disallow=%p/../Inputs/allow-disallow/one.yaml \ RUN: | FileCheck %s --check-prefix=DISALLOW-ONE RUN: dsymutil --linker parallel --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --disallow=%p/../Inputs/allow-disallow/one.yaml \ RUN: | FileCheck %s --check-prefix=DISALLOW-ONE # Test --disallow to exclude two object files (1.o and 3.o). RUN: dsymutil --linker classic --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --disallow=%p/../Inputs/allow-disallow/two.yaml \ RUN: | FileCheck %s --check-prefix=DISALLOW-TWO RUN: dsymutil --linker parallel --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --disallow=%p/../Inputs/allow-disallow/two.yaml \ RUN: | FileCheck %s --check-prefix=DISALLOW-TWO # Test --disallow to exclude no object files (empty allow list). RUN: dsymutil --linker classic --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --disallow=%p/../Inputs/allow-disallow/empty.yaml \ RUN: | FileCheck %s --check-prefix=DISALLOW-NONE RUN: dsymutil --linker parallel --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --oso-prepend-path=%p/../Inputs \ RUN: --disallow=%p/../Inputs/allow-disallow/empty.yaml \ RUN: | FileCheck %s --check-prefix=DISALLOW-NONE # Test error when allow-list file does not exist. RUN: not dsymutil --linker classic --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --allow=/nonexistent/path 2>&1 \ RUN: | FileCheck %s --check-prefix=MISSING-FILE RUN: not dsymutil --linker parallel --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --allow=/nonexistent/path 2>&1 \ RUN: | FileCheck %s --check-prefix=MISSING-FILE # Test error when disallow-list file does not exist. RUN: not dsymutil --linker classic --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --disallow=/nonexistent/path 2>&1 \ RUN: | FileCheck %s --check-prefix=MISSING-FILE RUN: not dsymutil --linker parallel --dump-debug-map \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 \ RUN: --disallow=/nonexistent/path 2>&1 \ RUN: | FileCheck %s --check-prefix=MISSING-FILE # Test error when combined with -y. RUN: not dsymutil --linker classic --allow=some.file.yaml \ RUN: -y %p/../Inputs/remarks/basic.macho.remarks.arm64 2>&1 \ RUN: | FileCheck %s --check-prefix=YAML-CONFLICT RUN: not dsymutil --linker parallel --allow=some.file.yaml \ RUN: -y %p/../Inputs/remarks/basic.macho.remarks.arm64 2>&1 \ RUN: | FileCheck %s --check-prefix=YAML-CONFLICT # Test error when --allow and --disallow are both specified. RUN: not dsymutil --linker classic --allow=some.file.yaml --disallow=some.file.yaml \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 2>&1 \ RUN: | FileCheck %s --check-prefix=ALLOW-DISALLOW-CONFLICT RUN: not dsymutil --linker parallel --allow=some.file.yaml --disallow=some.file.yaml \ RUN: %p/../Inputs/allow-disallow/a.out.arm64 2>&1 \ RUN: | FileCheck %s --check-prefix=ALLOW-DISALLOW-CONFLICT ALLOW-ONE: --- ALLOW-ONE: filename: {{.*}}1.o ALLOW-ONE-NOT: filename: ALLOW-ONE: ... ALLOW-TWO: --- ALLOW-TWO: filename: {{.*}}1.o ALLOW-TWO-NOT: filename: {{.*}}2.o ALLOW-TWO: filename: {{.*}}3.o ALLOW-TWO-NOT: filename: ALLOW-TWO: ... ALLOW-NONE: --- ALLOW-NONE-NOT: filename: ALLOW-NONE: ... DISALLOW-ONE: --- DISALLOW-ONE-NOT: filename: {{.*}}1.o DISALLOW-ONE: filename: {{.*}}2.o DISALLOW-ONE: filename: {{.*}}3.o DISALLOW-ONE-NOT: filename: DISALLOW-ONE: ... DISALLOW-TWO: --- DISALLOW-TWO-NOT: filename: {{.*}}1.o DISALLOW-TWO: filename: {{.*}}2.o DISALLOW-TWO-NOT: filename: {{.*}}3.o DISALLOW-TWO-NOT: filename: DISALLOW-TWO: ... DISALLOW-NONE: --- DISALLOW-NONE: filename: {{.*}}1.o DISALLOW-NONE: filename: {{.*}}2.o DISALLOW-NONE: filename: {{.*}}3.o DISALLOW-NONE: ... MISSING-FILE: error: cannot open allow/disallow file YAML-CONFLICT: error: -y and --allow/--disallow cannot be specified together ALLOW-DISALLOW-CONFLICT: error: --allow and --disallow cannot be specified together