diff options
Diffstat (limited to 'test/Driver/clang_f_opts.c')
-rw-r--r-- | test/Driver/clang_f_opts.c | 78 |
1 files changed, 76 insertions, 2 deletions
diff --git a/test/Driver/clang_f_opts.c b/test/Driver/clang_f_opts.c index 5451945..8bf53e5 100644 --- a/test/Driver/clang_f_opts.c +++ b/test/Driver/clang_f_opts.c @@ -15,11 +15,11 @@ // CHECK-OPTIONS2: -fno-show-source-location // RUN: %clang -### -S -Wwrite-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s +// RUN: %clang -### -S -Weverything %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s // WRITE-STRINGS1: -fconst-strings // RUN: %clang -### -S -Wwrite-strings -Wno-write-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s +// RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s // WRITE-STRINGS2-NOT: -fconst-strings -// RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS3 %s -// WRITE-STRINGS3: -fconst-strings // RUN: %clang -### -x c++ -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s // RUN: %clang -### -x c++ -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s @@ -37,6 +37,23 @@ // FP-CONTRACT-FAST-CHECK: -ffp-contract=fast // FP-CONTRACT-OFF-CHECK: -ffp-contract=off +// RUN: %clang -### -S -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s +// RUN: %clang -### -S -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s +// RUN: %clang -### -S -fno-unroll-loops -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s +// RUN: %clang -### -S -funroll-loops -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s +// CHECK-UNROLL-LOOPS: "-funroll-loops" +// CHECK-NO-UNROLL-LOOPS: "-fno-unroll-loops" + +// RUN: %clang -### -S -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s +// RUN: %clang -### -S -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s +// RUN: %clang -### -S -fno-reroll-loops -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s +// RUN: %clang -### -S -freroll-loops -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s +// CHECK-REROLL-LOOPS: "-freroll-loops" +// CHECK-NO-REROLL-LOOPS-NOT: "-freroll-loops" + +// RUN: %clang -### -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s +// CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof" + // RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s // RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s // RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s @@ -45,6 +62,17 @@ // RUN: %clang -### -S -fno-tree-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s // RUN: %clang -### -S -fno-tree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s // RUN: %clang -### -S -ftree-vectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -S -fno-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -S -O1 -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s // CHECK-VECTORIZE: "-vectorize-loops" // CHECK-NO-VECTORIZE-NOT: "-vectorize-loops" @@ -71,3 +99,49 @@ // CHECK-EXTENDED-IDENTIFIERS: "-cc1" // CHECK-EXTENDED-IDENTIFIERS-NOT: "-fextended-identifiers" // CHECK-NO-EXTENDED-IDENTIFIERS: error: unsupported option '-fno-extended-identifiers' + +// RUN: %clang -### -S -fno-pascal-strings -mpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-M-PASCAL-STRINGS %s +// CHECK-M-PASCAL-STRINGS: "-fpascal-strings" + +// RUN: %clang -### -S -fpascal-strings -mno-pascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-NO-M-PASCAL-STRINGS %s +// CHECK-NO-M-PASCAL-STRINGS-NOT: "-fpascal-strings" + +// RUN: %clang -### -S -O4 %s 2>&1 | FileCheck -check-prefix=CHECK-MAX-O %s +// CHECK-MAX-O: warning: -O4 is equivalent to -O3 +// CHECK-MAX-O: -O3 + +// RUN: %clang -S -O20 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-O %s +// CHECK-INVALID-O: warning: optimization level '-O20' is unsupported; using '-O3' instead + +// Test that we don't error on these. +// RUN: %clang -### -S -Werror \ +// RUN: -falign-functions -falign-functions=2 -fno-align-functions \ +// RUN: -fasynchronous-unwind-tables -fno-asynchronous-unwind-tables \ +// RUN: -fbuiltin -fno-builtin \ +// RUN: -fdiagnostics-show-location=once \ +// RUN: -ffloat-store -fno-float-store \ +// RUN: -feliminate-unused-debug-types -fno-eliminate-unused-debug-types \ +// RUN: -fgcse -fno-gcse \ +// RUN: -fident -fno-ident \ +// RUN: -fimplicit-templates -fno-implicit-templates \ +// RUN: -fivopts -fno-ivopts \ +// RUN: -fnon-call-exceptions -fno-non-call-exceptions \ +// RUN: -fpermissive -fno-permissive \ +// RUN: -fprefetch-loop-arrays -fno-prefetch-loop-arrays \ +// RUN: -fprofile-correction -fno-profile-correction \ +// RUN: -fprofile-dir=bar \ +// RUN: -fprofile-use -fprofile-use=zed -fno-profile-use \ +// RUN: -fprofile-values -fno-profile-values \ +// RUN: -frounding-math -fno-rounding-math \ +// RUN: -fsee -fno-see \ +// RUN: -ftracer -fno-tracer \ +// RUN: -funroll-all-loops -fno-unroll-all-loops \ +// RUN: -fuse-ld=gold \ +// RUN: -fno-builtin-foobar \ +// RUN: -fno-builtin-strcat -fno-builtin-strcpy \ +// RUN: -fno-var-tracking \ +// RUN: -fno-unsigned-char \ +// RUN: -fno-signed-char \ +// RUN: -fstrength-reduce -fno-strength-reduce \ +// RUN: %s 2>&1 | FileCheck --check-prefix=IGNORE %s +// IGNORE-NOT: error: unknown argument |