From a1e940b1853a69b14b1f66952256e8cb16e6a0aa Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 15 Mar 2020 13:06:47 -0700 Subject: [Driver][test] Add a specific test file for -fmerge-all-constants Also, delete the option from the `// Test that we don't error on these.` block in test/Driver/clang_f_opts.c --- clang/test/Driver/clang_f_opts.c | 8 -------- clang/test/Driver/fmerge-constants.c | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 clang/test/Driver/fmerge-constants.c diff --git a/clang/test/Driver/clang_f_opts.c b/clang/test/Driver/clang_f_opts.c index bda026715c36..180d4713dcb4 100644 --- a/clang/test/Driver/clang_f_opts.c +++ b/clang/test/Driver/clang_f_opts.c @@ -304,7 +304,6 @@ // RUN: -fno-inline-small-functions -finline-small-functions \ // RUN: -fno-fat-lto-objects -ffat-lto-objects \ // RUN: -fno-merge-constants -fmerge-constants \ -// RUN: -fno-merge-all-constants -fmerge-all-constants \ // RUN: -fno-caller-saves -fcaller-saves \ // RUN: -fno-reorder-blocks -freorder-blocks \ // RUN: -fno-schedule-insns2 -fschedule-insns2 \ @@ -544,13 +543,6 @@ // CHECK-DISCARD-NAMES: "-discard-value-names" // CHECK-NO-DISCARD-NAMES-NOT: "-discard-value-names" -// RUN: %clang -### -S -fmerge-all-constants %s 2>&1 | FileCheck -check-prefix=CHECK-MERGE-ALL-CONSTANTS %s -// RUN: %clang -### -S -fno-merge-all-constants %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MERGE-ALL-CONSTANTS %s -// RUN: %clang -### -S -fmerge-all-constants -fno-merge-all-constants %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MERGE-ALL-CONSTANTS %s -// RUN: %clang -### -S -fno-merge-all-constants -fmerge-all-constants %s 2>&1 | FileCheck -check-prefix=CHECK-MERGE-ALL-CONSTANTS %s -// CHECK-NO-MERGE-ALL-CONSTANTS-NOT: "-fmerge-all-constants" -// CHECK-MERGE-ALL-CONSTANTS: "-fmerge-all-constants" - // RUN: %clang -### -S -fdelete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NULL-POINTER-CHECKS %s // RUN: %clang -### -S -fno-delete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NO-NULL-POINTER-CHECKS %s // RUN: %clang -### -S -fdelete-null-pointer-checks -fno-delete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NO-NULL-POINTER-CHECKS %s diff --git a/clang/test/Driver/fmerge-constants.c b/clang/test/Driver/fmerge-constants.c new file mode 100644 index 000000000000..c478a9d7b1e5 --- /dev/null +++ b/clang/test/Driver/fmerge-constants.c @@ -0,0 +1,6 @@ +// RUN: %clang -### -c %s -fno-merge-all-constants -fmerge-all-constants 2>&1 | FileCheck %s +// CHECK: "-fmerge-all-constants" + +// RUN: %clang -### -c %s 2>&1 | FileCheck --check-prefix=NO %s +// RUN: %clang -### -c %s -fmerge-all-constants -fno-merge-all-constants 2>&1 | FileCheck --check-prefix=NO %s +// NO-NOT: "-fmerge-all-constants" -- cgit v1.2.3