46 lines · plain
1! Test for errors and warnings generated when parsing driver options. You can2! use this file for relatively small tests and to avoid creating new test files.3 4! RUN: %flang -### -S -O4 -ffp-contract=on %s 2>&1 | FileCheck %s5 6! CHECK: warning: the argument 'on' is not supported for option 'ffp-contract='. Mapping to 'ffp-contract=off'7! CHECK: warning: -O4 is equivalent to -O38! CHECK-LABEL: "-fc1"9! CHECK: -ffp-contract=off10! CHECK: -O311 12! RUN: %flang -### -S -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-LLVM %s13! CHECK-PROFILE-GENERATE-LLVM: "-fprofile-generate"14! RUN: %flang -### -S -fprofile-use=%S %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-DIR %s15! CHECK-PROFILE-USE-DIR: "-fprofile-use={{.*}}"16 17! RUN: %flang -### -fbuiltin %s 2>&1 \18! RUN: | FileCheck %s -check-prefix=WARN-BUILTIN19! WARN-BUILTIN: warning: '-fbuiltin' is not valid for Fortran20 21! RUN: %flang -### -fno-builtin %s 2>&1 \22! RUN: | FileCheck %s -check-prefix=WARN-NO-BUILTIN23! WARN-NO-BUILTIN: warning: '-fno-builtin' is not valid for Fortran24 25! RUN: %flang -### -fbuiltin -fno-builtin %s 2>&1 \26! RUN: | FileCheck %s -check-prefix=WARN-BUILTIN-MULTIPLE27! WARN-BUILTIN-MULTIPLE: warning: '-fbuiltin' is not valid for Fortran28! WARN-BUILTIN-MULTIPLE: warning: '-fno-builtin' is not valid for Fortran29 30! When emitting an error with a suggestion, ensure that the diagnostic message31! uses '-Xflang' instead of '-Xclang'. This is typically emitted when an option32! that is available for `flang -fc1` is passed to `flang`. We use -complex-range33! since it is only available for fc1. If this option is ever exposed to `flang`,34! a different option will have to be used in the test below.35!36! RUN: not %flang -### -complex-range=full %s 2>&1 \37! RUN: | FileCheck %s -check-prefix UNKNOWN-SUGGEST38!39! UNKNOWN-SUGGEST: error: unknown argument '-complex-range=full';40! UNKNOWN-SUGGEST-SAME: did you mean '-Xflang -complex-range=full'41!42! RUN: not %flang -### -not-an-option %s 2>&1 \43! RUN: | FileCheck %s -check-prefix UNKNOWN-NO-SUGGEST44!45! UNKNOWN-NO-SUGGEST: error: unknown argument: '-not-an-option'{{$}}46