639 lines · c
1// UNSUPPORTED: target={{.*}}-aix{{.*}}2// RUN: %clang -### -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fsplit-stack %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s3// RUN: %clang -### -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-asm -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-enums -fprotect-parens %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s4 5// CHECK-OPTIONS1: -fsplit-stack6// CHECK-OPTIONS1: -fgnu-keywords7// CHECK-OPTIONS1: -fblocks8// CHECK-OPTIONS1: -fpascal-strings9 10// CHECK-OPTIONS2: -fprotect-parens11// CHECK-OPTIONS2: -fmath-errno12// CHECK-OPTIONS2: -fno-gnu-keywords13// CHECK-OPTIONS2: -fno-builtin14// CHECK-OPTIONS2: -fshort-enums15// CHECK-OPTIONS2-NOT: -fcommon16// CHECK-OPTIONS2: -fno-show-source-location17 18// RUN: %clang -### -S -Wwrite-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s19// WRITE-STRINGS1: -fconst-strings20// RUN: %clang -### -S -Wwrite-strings -Wno-write-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s21// WRITE-STRINGS2-NOT: -fconst-strings22// RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS3 %s23// WRITE-STRINGS3-NOT: -fconst-strings24 25// RUN: %clang -### -x c++ -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s26// RUN: %clang -### -x c++ -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s27// RUN: %clang -### -x c++ -c -Wno-deprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s28// RUN: %clang -### -x c++ -c -Wno-deprecated -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s29// RUN: %clang -### -x c++ -c -w %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s30// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s31// RUN: %clang -### -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s32// DEPRECATED-ON-CHECK: -fdeprecated-macro33// DEPRECATED-OFF-CHECK-NOT: -fdeprecated-macro34 35// RUN: %clang -### -S -ffp-contract=fast %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s36// RUN: %clang -### -S -ffast-math %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s37// RUN: %clang -### -S -ffp-contract=off %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-OFF-CHECK %s38// FP-CONTRACT-FAST-CHECK: -ffp-contract=fast39// FP-CONTRACT-OFF-CHECK: -ffp-contract=off40 41// RUN: %clang -### -S -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s42// RUN: %clang -### -S -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s43// RUN: %clang -### -S -fno-unroll-loops -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s44// RUN: %clang -### -S -funroll-loops -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s45// CHECK-UNROLL-LOOPS: "-funroll-loops"46// CHECK-NO-UNROLL-LOOPS: "-fno-unroll-loops"47 48// RUN: %clang -### -S -floop-interchange %s 2>&1 | FileCheck -check-prefix=CHECK-INTERCHANGE-LOOPS %s49// RUN: %clang -### -S -fno-loop-interchange %s 2>&1 | FileCheck -check-prefix=CHECK-NO-INTERCHANGE-LOOPS %s50// RUN: %clang -### -S -fno-loop-interchange -floop-interchange %s 2>&1 | FileCheck -check-prefix=CHECK-INTERCHANGE-LOOPS %s51// RUN: %clang -### -S -floop-interchange -fno-loop-interchange %s 2>&1 | FileCheck -check-prefix=CHECK-NO-INTERCHANGE-LOOPS %s52// CHECK-INTERCHANGE-LOOPS: "-floop-interchange"53// CHECK-NO-INTERCHANGE-LOOPS: "-fno-loop-interchange"54 55// RUN: %clang -### -S -fexperimental-loop-fusion %s -o /dev/null 2>&1 | FileCheck -check-prefix=CHECK-FUSE-LOOPS %s56// CHECK-FUSE-LOOPS: "-fexperimental-loop-fusion"57//58// RUN: %clang -c -fexperimental-loop-fusion -mllvm -print-pipeline-passes -O3 %s -o /dev/null 2>&1 | FileCheck --check-prefixes=LOOP-FUSION-ON %s59// RUN: %clang -c -mllvm -print-pipeline-passes -O3 %s -o /dev/null 2>&1 | FileCheck --check-prefixes=LOOP-FUSION-OFF %s60 61// LOOP-FUSION-ON: loop-fusion62// LOOP-FUSION-OFF-NOT: loop-fusion63 64// RUN: %clang -### -S -fprofile-sample-accurate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-SAMPLE-ACCURATE %s65// CHECK-PROFILE-SAMPLE-ACCURATE: "-fprofile-sample-accurate"66 67// RUN: %clang -### -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s68// CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"69 70//71// RUN: %clang -### -x cuda -nocudainc -nocudalib \72// RUN: -c -fprofile-sample-use=%S/Inputs/file.prof --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \73// RUN: | FileCheck -check-prefix=CHECK-CUDA-SAMPLE-PROFILE %s74// -fprofile-sample-use should not be passed to the GPU compilation75// CHECK-CUDA-SAMPLE-PROFILE: "-cc1"76// CHECK-CUDA-SAMPLE-PROFILE-SAME: "-triple" "nvptx77// CHECK-CUDA-SAMPLE-PROFILE-NOT: "-fprofile-sample-use={{.*}}/file.prof"78// Host compilation should still have the option.79// CHECK-CUDA-SAMPLE-PROFILE: "-cc1"80// CHECK-CUDA-SAMPLE-PROFILE-SAME: "-fprofile-sample-use={{.*}}/file.prof"81 82 83// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s84// CHECK-AUTO-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"85 86// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof -fno-profile-sample-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-AUTO-PROFILE %s87// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof -fno-auto-profile %s 2>&1 | FileCheck -check-prefix=CHECK-NO-AUTO-PROFILE %s88// CHECK-NO-AUTO-PROFILE-NOT: "-fprofile-sample-use={{.*}}/file.prof"89 90// RUN: %clang -### -S -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-LLVM %s91// RUN: %clang -### -S -fprofile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s92// RUN: %clang -### -S -fprofile-generate=/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-DIR %s93// RUN: %clang -### -S -fprofile-instr-generate=/tmp/somefile.profraw %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-FILE %s94// RUN: not %clang -### -S -fprofile-generate -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s95// RUN: not %clang -### -S -fprofile-generate -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s96// RUN: not %clang -### -S -fprofile-generate -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s97// RUN: not %clang -### -S -fprofile-generate -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s98// RUN: not %clang -### -S -fprofile-instr-generate -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s99// RUN: not %clang -### -S -fprofile-instr-generate -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s100// RUN: not %clang -### -S -fprofile-instr-generate -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s101// RUN: not %clang -### -S -fprofile-instr-generate -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s102// RUN: not %clang -### -S -fprofile-instr-generate=file -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s103// RUN: not %clang -### -S -fprofile-instr-generate=file -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s104// RUN: not %clang -### -S -fprofile-instr-generate=file -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s105// RUN: not %clang -### -S -fprofile-instr-generate=file -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s106// RUN: not %clang -### -S -fprofile-generate=dir -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s107// RUN: not %clang -### -S -fprofile-generate=dir -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s108// RUN: not %clang -### -S -fprofile-generate=dir -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s109// RUN: not %clang -### -S -fprofile-generate=dir -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s110// RUN: %clang -### -S -fprofile-instr-generate=file -fno-profile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s111// RUN: not %clang -### -S -fprofile-instr-generate -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GENERATE %s112// RUN: not %clang -### -S -fprofile-instr-generate -fprofile-generate=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GENERATE %s113// RUN: %clang -### -S -fprofile-generate=dir -fno-profile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s114// RUN: %clang -### -S -fprofile-instr-use=file -fno-profile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s115// RUN: %clang -### -S -fprofile-instr-use=file -fno-profile-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s116// RUN: %clang -### -S -fprofile-use=file -fno-profile-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s117// RUN: %clang -### -S -fprofile-use=file -fno-profile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s118// RUN: not %clang -### -S -fcoverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-COVERAGE-AND-GEN %s119// RUN: %clang -### -S -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s120// RUN: %clang -### -S -fprofile-instr-generate -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s121// RUN: %clang -### -S -fprofile-remapping-file=foo/bar.txt %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-REMAP %s122// CHECK-PROFILE-GENERATE: "-fprofile-instrument=clang"123// CHECK-PROFILE-GENERATE-LLVM: "-fprofile-instrument=llvm"124// CHECK-PROFILE-GENERATE-DIR: "-fprofile-instrument-path=/some/dir{{/|\\\\}}{{.*}}"125// CHECK-PROFILE-GENERATE-FILE: "-fprofile-instrument-path=/tmp/somefile.profraw"126// CHECK-NO-MIX-GEN-USE: '{{[a-z=-]*}}' not allowed with '{{[a-z=-]*}}'127// CHECK-NO-MIX-GENERATE: '{{[a-z=-]*}}' not allowed with '{{[a-z=-]*}}'128// CHECK-DISABLE-GEN-NOT: "-fprofile-instrument=clang"129// CHECK-DISABLE-USE-NOT: "-fprofile-instr-use"130// CHECK-COVERAGE-AND-GEN: '-fcoverage-mapping' only allowed with '-fprofile-instr-generate'131// CHECK-DISABLE-COVERAGE-NOT: "-fcoverage-mapping"132// CHECK-PROFILE-REMAP: "-fprofile-remapping-file=foo/bar.txt"133 134// RUN: rm -rf %t && mkdir %t135// RUN: llvm-profdata merge -o %t/somefile.prof %S/Inputs/a.proftext136// RUN: llvm-profdata merge -o %t/default.profdata %S/Inputs/a.proftext137// RUN: cd %t138 139// RUN: %clang -### -S -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s140// RUN: %clang -### -S -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s141// RUN: mkdir -p %t/some/dir142// RUN: cp %t/default.profdata %t/some/dir143// RUN: %clang -### -S -fprofile-use=%t/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-DIR %s144// RUN: %clang -### -S -fprofile-instr-use=%t/somefile.prof %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s145// CHECK-PROFILE-USE: "-fprofile-instrument-use-path=default.profdata"146// CHECK-PROFILE-USE-DIR: "-fprofile-instrument-use-path={{.*}}some/dir{{/|\\\\}}default.profdata"147// CHECK-PROFILE-USE-FILE: "-fprofile-instrument-use-path={{.*}}somefile.prof"148 149// RUN: %clang -### -S -fprofile-instr-use=%t/somefile.prof -fdiagnostics-misexpect-tolerance=10 -Wmisexpect %s 2>&1 | FileCheck %s --check-prefix=CHECK-MISEXPECT-TOLLERANCE150// CHECK-MISEXPECT-TOLLERANCE: "-fdiagnostics-misexpect-tolerance=10"151// CHECK-MISEXPECT-TOLLERANCE-NOT: argument unused152 153// RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s154// RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s155// RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s156// RUN: %clang -### -S -fvectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s157// RUN: %clang -### -S -ftree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s158// RUN: %clang -### -S -fno-tree-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s159// RUN: %clang -### -S -fno-tree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s160// RUN: %clang -### -S -ftree-vectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s161// RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s162// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s163// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s164// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s165// RUN: %clang -### -S -fno-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s166// RUN: %clang -### -S -O1 -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s167// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s168// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s169// RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s170// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s171// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s172// CHECK-VECTORIZE: "-vectorize-loops"173// CHECK-NO-VECTORIZE-NOT: "-vectorize-loops"174 175// RUN: %clang -### -S -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s176// RUN: %clang -### -S -fno-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s177// RUN: %clang -### -S -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s178// RUN: %clang -### -S -fslp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s179// RUN: %clang -### -S -ftree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s180// RUN: %clang -### -S -fno-tree-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s181// RUN: %clang -### -S -fno-tree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s182// RUN: %clang -### -S -ftree-slp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s183// RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s184// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s185// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s186// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s187// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s188// RUN: %clang -### -S -fno-slp-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s189// RUN: %clang -### -S -O1 -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s190// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s191// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s192// RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s193// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s194// CHECK-SLP-VECTORIZE: "-vectorize-slp"195// CHECK-NO-SLP-VECTORIZE-NOT: "-vectorize-slp"196 197// RUN: %clang -### -S -fextended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-EXTENDED-IDENTIFIERS %s198// RUN: not %clang -### -S -fno-extended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-NO-EXTENDED-IDENTIFIERS %s199// CHECK-EXTENDED-IDENTIFIERS: "-cc1"200// CHECK-EXTENDED-IDENTIFIERS-NOT: "-fextended-identifiers"201// CHECK-NO-EXTENDED-IDENTIFIERS: error: unsupported option '-fno-extended-identifiers'202 203// RUN: %clang -### -S -frounding-math %s 2>&1 | FileCheck -check-prefix=CHECK-ROUNDING-MATH %s204// CHECK-ROUNDING-MATH: "-cc1"205// CHECK-ROUNDING-MATH: "-frounding-math"206// CHECK-ROUNDING-MATH-NOT: "-fno-rounding-math"207// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-ROUNDING-MATH-NOT %s208// RUN: not %clang -### -S -ffp-model=imprecise %s 2>&1 | FileCheck -check-prefix=CHECK-FPMODEL %s209// CHECK-FPMODEL: unsupported argument 'imprecise' to option '-ffp-model='210// RUN: %clang -### -S -ffp-model=precise %s 2>&1 | FileCheck -check-prefix=IGNORE %s211// RUN: %clang -### -S -ffp-model=strict %s 2>&1 | FileCheck -check-prefix=IGNORE %s212// RUN: %clang -### -S -ffp-model=fast %s 2>&1 | FileCheck -check-prefix=IGNORE %s213// RUN: not %clang -### -S -ffp-exception-behavior=trap %s 2>&1 | FileCheck -check-prefix=CHECK-FPEB %s214// CHECK-FPEB: unsupported argument 'trap' to option '-ffp-exception-behavior='215// RUN: %clang -### -S -ffp-exception-behavior=maytrap %s 2>&1 | FileCheck -check-prefix=IGNORE %s216// RUN: %clang -### -S -ffp-exception-behavior=ignore %s 2>&1 | FileCheck -check-prefix=IGNORE %s217// RUN: %clang -### -S -ffp-exception-behavior=strict %s 2>&1 | FileCheck -check-prefix=IGNORE %s218 219// RUN: %clang -### -S -fno-pascal-strings -mpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-M-PASCAL-STRINGS %s220// CHECK-M-PASCAL-STRINGS: "-fpascal-strings"221 222// RUN: %clang -### -S -fpascal-strings -mno-pascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-NO-M-PASCAL-STRINGS %s223// CHECK-NO-M-PASCAL-STRINGS-NOT: "-fpascal-strings"224 225// RUN: %clang -### -S -O4 %s 2>&1 | FileCheck -check-prefix=CHECK-MAX-O %s226// CHECK-MAX-O: warning: -O4 is equivalent to -O3227// CHECK-MAX-O: -O3228 229// RUN: %clang -S -O20 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-O %s230// CHECK-INVALID-O: warning: optimization level '-O20' is not supported; using '-O3' instead231 232// RUN: not %clang -### -S -finput-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-INPUT-CHARSET %s233// CHECK-INVALID-INPUT-CHARSET: error: invalid value 'iso-8859-1' in '-finput-charset=iso-8859-1'234 235// RUN: not %clang -### -S -fexec-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-EXEC-CHARSET %s236// CHECK-INVALID-EXEC-CHARSET: error: invalid value 'iso-8859-1' in '-fexec-charset=iso-8859-1'237 238// Test that we don't error on these.239// RUN: not %clang -### -S -Werror \240// RUN: -falign-functions -falign-functions=2 -fno-align-functions \241// RUN: -fasynchronous-unwind-tables -fno-asynchronous-unwind-tables \242// RUN: -fbuiltin -fno-builtin \243// RUN: -fdiagnostics-show-location=once \244// RUN: -ffloat-store -fno-float-store \245// RUN: -feliminate-unused-debug-types -fno-eliminate-unused-debug-types \246// RUN: -fgcse -fno-gcse \247// RUN: -fident -fno-ident \248// RUN: -fimplicit-templates -fno-implicit-templates \249// RUN: -finput-charset=UTF-8 \250// RUN: -fexec-charset=UTF-8 \251// RUN: -fivopts -fno-ivopts \252// RUN: -fnon-call-exceptions -fno-non-call-exceptions \253// RUN: -fpermissive -fno-permissive \254// RUN: -fdefer-pop -fno-defer-pop \255// RUN: -fprefetch-loop-arrays -fno-prefetch-loop-arrays \256// RUN: -fprofile-correction -fno-profile-correction \257// RUN: -fprofile-values -fno-profile-values \258// RUN: -frounding-math -fno-rounding-math \259// RUN: -fsee -fno-see \260// RUN: -ftracer -fno-tracer \261// RUN: -funroll-all-loops -fno-unroll-all-loops \262// RUN: -fuse-ld=gold \263// RUN: -fno-builtin-foobar \264// RUN: -fno-builtin-strcat -fno-builtin-strcpy \265// RUN: -fno-var-tracking \266// RUN: -fno-unsigned-char \267// RUN: -fno-signed-char \268// RUN: -fstrength-reduce -fno-strength-reduce \269// RUN: -finline-limit=1000 \270// RUN: -finline-limit \271// RUN: -flto=1 \272// RUN: -falign-labels \273// RUN: -falign-labels=100 \274// RUN: -falign-loops \275// RUN: -falign-loops=100 \276// RUN: -falign-jumps \277// RUN: -falign-jumps=100 \278// RUN: -fexcess-precision=100 \279// RUN: -fbranch-count-reg \280// RUN: -fcaller-saves \281// RUN: -fno-default-inline -fdefault-inline \282// RUN: -fgcse-after-reload \283// RUN: -fgcse-las \284// RUN: -fgcse-sm \285// RUN: -fipa-cp \286// RUN: -finline-functions-called-once \287// RUN: -fmodulo-sched \288// RUN: -fmodulo-sched-allow-regmoves \289// RUN: -fpeel-loops \290// RUN: -frename-registers \291// RUN: -fschedule-insns2 \292// RUN: -fsingle-precision-constant \293// RUN: -funsafe-loop-optimizations \294// RUN: -fuse-linker-plugin \295// RUN: -fvect-cost-model \296// RUN: -fvariable-expansion-in-unroller \297// RUN: -fweb \298// RUN: -fwhole-program \299// RUN: -fno-tree-dce -ftree-dce \300// RUN: -fno-tree-ter -ftree-ter \301// RUN: -fno-tree-vrp -ftree-vrp \302// RUN: -fno-delete-null-pointer-checks -fdelete-null-pointer-checks \303// RUN: -fno-inline-small-functions -finline-small-functions \304// RUN: -fno-fat-lto-objects -ffat-lto-objects \305// RUN: -flto=auto -flto=jobserver \306// RUN: -fno-merge-constants -fmerge-constants \307// RUN: -fno-caller-saves -fcaller-saves \308// RUN: -fno-reorder-blocks -freorder-blocks \309// RUN: -fno-schedule-insns2 -fschedule-insns2 \310// RUN: -fno-stack-check \311// RUN: -ffriend-injection \312// RUN: -fno-implement-inlines -fimplement-inlines \313// RUN: -fstack-check \314// RUN: -fforce-addr \315// RUN: -malign-functions=100 \316// RUN: -malign-loops=100 \317// RUN: -malign-jumps=100 \318// RUN: %s 2>&1 | FileCheck --check-prefix=IGNORE %s319// IGNORE-NOT: error: unknown argument320 321// Test that the warning is displayed on these.322// RUN: not %clang -### \323// RUN: -finline-limit=1000 \324// RUN: -finline-limit \325// RUN: -fexpensive-optimizations \326// RUN: -fno-expensive-optimizations \327// RUN: -fno-defer-pop \328// RUN: -fkeep-inline-functions \329// RUN: -fno-keep-inline-functions \330// RUN: -freorder-blocks \331// RUN: -ffloat-store \332// RUN: -fgcse \333// RUN: -fivopts \334// RUN: -fprefetch-loop-arrays \335// RUN: -fprofile-correction \336// RUN: -fprofile-values \337// RUN: -fschedule-insns \338// RUN: -fsignaling-nans \339// RUN: -fstrength-reduce \340// RUN: -ftracer \341// RUN: -funroll-all-loops \342// RUN: -funswitch-loops \343// RUN: -flto=1 \344// RUN: -falign-labels \345// RUN: -falign-labels=100 \346// RUN: -falign-loops \347// RUN: -falign-loops=100 \348// RUN: -falign-jumps \349// RUN: -falign-jumps=100 \350// RUN: -fexcess-precision=100 \351// RUN: -fbranch-count-reg \352// RUN: -fcaller-saves \353// RUN: -fno-default-inline \354// RUN: -fgcse-after-reload \355// RUN: -fgcse-las \356// RUN: -fgcse-sm \357// RUN: -fipa-cp \358// RUN: -finline-functions-called-once \359// RUN: -fmodulo-sched \360// RUN: -fmodulo-sched-allow-regmoves \361// RUN: -fpeel-loops \362// RUN: -frename-registers \363// RUN: -fschedule-insns2 \364// RUN: -fsingle-precision-constant \365// RUN: -funsafe-loop-optimizations \366// RUN: -fuse-linker-plugin \367// RUN: -fvect-cost-model \368// RUN: -fvariable-expansion-in-unroller \369// RUN: -fweb \370// RUN: -fwhole-program \371// RUN: -fcaller-saves \372// RUN: -freorder-blocks \373// RUN: -ffat-lto-objects \374// RUN: -fmerge-constants \375// RUN: -finline-small-functions \376// RUN: -ftree-dce \377// RUN: -ftree-ter \378// RUN: -ftree-vrp \379// RUN: -fno-devirtualize \380// RUN: -fno-devirtualize-speculatively \381// RUN: -fslp-vectorize-aggressive \382// RUN: -fno-slp-vectorize-aggressive \383// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s384// CHECK-WARNING-DAG: optimization flag '-finline-limit=1000' is not supported385// CHECK-WARNING-DAG: optimization flag '-finline-limit' is not supported386// CHECK-WARNING-DAG: optimization flag '-fexpensive-optimizations' is not supported387// CHECK-WARNING-DAG: optimization flag '-fno-expensive-optimizations' is not supported388// CHECK-WARNING-DAG: optimization flag '-fno-defer-pop' is not supported389// CHECK-WARNING-DAG: optimization flag '-fkeep-inline-functions' is not supported390// CHECK-WARNING-DAG: optimization flag '-fno-keep-inline-functions' is not supported391// CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported392// CHECK-WARNING-DAG: optimization flag '-ffloat-store' is not supported393// CHECK-WARNING-DAG: optimization flag '-fgcse' is not supported394// CHECK-WARNING-DAG: optimization flag '-fivopts' is not supported395// CHECK-WARNING-DAG: optimization flag '-fprefetch-loop-arrays' is not supported396// CHECK-WARNING-DAG: optimization flag '-fprofile-correction' is not supported397// CHECK-WARNING-DAG: optimization flag '-fprofile-values' is not supported398// CHECK-WARNING-DAG: optimization flag '-fschedule-insns' is not supported399// CHECK-WARNING-DAG: optimization flag '-fsignaling-nans' is not supported400// CHECK-WARNING-DAG: optimization flag '-fstrength-reduce' is not supported401// CHECK-WARNING-DAG: optimization flag '-ftracer' is not supported402// CHECK-WARNING-DAG: optimization flag '-funroll-all-loops' is not supported403// CHECK-WARNING-DAG: optimization flag '-funswitch-loops' is not supported404// CHECK-WARNING-DAG: unsupported argument '1' to option '-flto='405// CHECK-WARNING-DAG: optimization flag '-falign-labels' is not supported406// CHECK-WARNING-DAG: optimization flag '-falign-labels=100' is not supported407// CHECK-WARNING-DAG: optimization flag '-falign-loops' is not supported408// CHECK-WARNING-DAG: optimization flag '-falign-jumps' is not supported409// CHECK-WARNING-DAG: optimization flag '-falign-jumps=100' is not supported410// CHECK-WARNING-DAG: unsupported argument '100' to option '-fexcess-precision='411// CHECK-WARNING-DAG: optimization flag '-fbranch-count-reg' is not supported412// CHECK-WARNING-DAG: optimization flag '-fcaller-saves' is not supported413// CHECK-WARNING-DAG: optimization flag '-fno-default-inline' is not supported414// CHECK-WARNING-DAG: optimization flag '-fgcse-after-reload' is not supported415// CHECK-WARNING-DAG: optimization flag '-fgcse-las' is not supported416// CHECK-WARNING-DAG: optimization flag '-fgcse-sm' is not supported417// CHECK-WARNING-DAG: optimization flag '-fipa-cp' is not supported418// CHECK-WARNING-DAG: optimization flag '-finline-functions-called-once' is not supported419// CHECK-WARNING-DAG: optimization flag '-fmodulo-sched' is not supported420// CHECK-WARNING-DAG: optimization flag '-fmodulo-sched-allow-regmoves' is not supported421// CHECK-WARNING-DAG: optimization flag '-fpeel-loops' is not supported422// CHECK-WARNING-DAG: optimization flag '-frename-registers' is not supported423// CHECK-WARNING-DAG: optimization flag '-fschedule-insns2' is not supported424// CHECK-WARNING-DAG: optimization flag '-fsingle-precision-constant' is not supported425// CHECK-WARNING-DAG: optimization flag '-funsafe-loop-optimizations' is not supported426// CHECK-WARNING-DAG: optimization flag '-fuse-linker-plugin' is not supported427// CHECK-WARNING-DAG: optimization flag '-fvect-cost-model' is not supported428// CHECK-WARNING-DAG: optimization flag '-fvariable-expansion-in-unroller' is not supported429// CHECK-WARNING-DAG: optimization flag '-fweb' is not supported430// CHECK-WARNING-DAG: optimization flag '-fwhole-program' is not supported431// CHECK-WARNING-DAG: optimization flag '-fcaller-saves' is not supported432// CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported433// CHECK-WARNING-DAG: optimization flag '-fmerge-constants' is not supported434// CHECK-WARNING-DAG: optimization flag '-finline-small-functions' is not supported435// CHECK-WARNING-DAG: optimization flag '-ftree-dce' is not supported436// CHECK-WARNING-DAG: optimization flag '-ftree-ter' is not supported437// CHECK-WARNING-DAG: optimization flag '-ftree-vrp' is not supported438// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize' is not supported439// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize-speculatively' is not supported440// CHECK-WARNING-DAG: the flag '-fslp-vectorize-aggressive' has been deprecated and will be ignored441// CHECK-WARNING-DAG: the flag '-fno-slp-vectorize-aggressive' has been deprecated and will be ignored442 443// Test that we mute the warning on these444// RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument \445// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING1 %s446// RUN: %clang -### -finline-limit -Wno-invalid-command-line-argument \447// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s448// RUN: %clang -### -finline-limit \449// RUN: -Winvalid-command-line-argument -Wno-ignored-optimization-argument \450// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s451// CHECK-NO-WARNING1-NOT: optimization flag '-finline-limit=1000' is not supported452// CHECK-NO-WARNING2-NOT: optimization flag '-finline-limit' is not supported453 454// Test that an ignored optimization argument only prints 1 warning,455// not both a warning about not claiming the arg, *and* about not supporting456// the arg; and that adding -Wno-ignored-optimization silences the warning.457//458// RUN: %clang -### -fprofile-correction %s 2>&1 \459// RUN: | FileCheck --check-prefix=CHECK-NO-WARNING3 %s460// CHECK-NO-WARNING3: optimization flag '-fprofile-correction' is not supported461// CHECK-NO-WARNING3-NOT: argument unused462// RUN: %clang -### -fprofile-correction -Wno-ignored-optimization-argument %s 2>&1 \463// RUN: | FileCheck --check-prefix=CHECK-NO-WARNING4 %s464// CHECK-NO-WARNING4-NOT: not supported465// CHECK-NO-WARNING4-NOT: argument unused466 467// RUN: %clang -### -S -fsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN1 %s468// CHAR-SIGN1-NOT: -fno-signed-char469 470// RUN: %clang -### -S -funsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN2 %s471// CHAR-SIGN2: -fno-signed-char472 473// RUN: %clang -### -S -fno-signed-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN3 %s474// CHAR-SIGN3: -fno-signed-char475 476// RUN: %clang -### -S -fno-unsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN4 %s477// CHAR-SIGN4-NOT: -fno-signed-char478 479// RUN: %clang --target=x86_64-unknown-none-none -### -fshort-wchar -fno-short-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR1 -check-prefix=DELIMITERS %s480// RUN: %clang --target=x86_64-unknown-none-none -### -fno-short-wchar -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR2 -check-prefix=DELIMITERS %s481// Make sure we don't match the -NOT lines with the linker invocation.482// Delimiters match the start of the cc1 and the start of the linker lines483// DELIMITERS: {{^ (\(in-process\)|")}}484// CHECK-WCHAR1: -fwchar-type=int485// CHECK-WCHAR1-NOT: -fwchar-type=short486// CHECK-WCHAR2: -fwchar-type=short487// CHECK-WCHAR2-NOT: -fwchar-type=int488// DELIMITERS: {{^ *"}}489 490// RUN: %clang -### -S -fstrict-return %s 2>&1 | FileCheck -check-prefix=CHECK-STRICT-RETURN %s491// RUN: %clang -### -S -fno-strict-return %s 2>&1 | FileCheck -check-prefix=CHECK-NO-STRICT-RETURN %s492// CHECK-STRICT-RETURN-NOT: "-fno-strict-return"493// CHECK-NO-STRICT-RETURN: "-fno-strict-return"494 495// RUN: %clang -### -S -fno-debug-info-for-profiling -fdebug-info-for-profiling %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DEBUG %s496// RUN: %clang -### -S -fdebug-info-for-profiling -fno-debug-info-for-profiling %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-DEBUG %s497// CHECK-PROFILE-DEBUG: -fdebug-info-for-profiling498// CHECK-NO-PROFILE-DEBUG-NOT: -fdebug-info-for-profiling499 500// RUN: %clang -### -S -fallow-editor-placeholders %s 2>&1 | FileCheck -check-prefix=CHECK-ALLOW-PLACEHOLDERS %s501// RUN: %clang -### -S -fno-allow-editor-placeholders %s 2>&1 | FileCheck -check-prefix=CHECK-NO-ALLOW-PLACEHOLDERS %s502// CHECK-ALLOW-PLACEHOLDERS: -fallow-editor-placeholders503// CHECK-NO-ALLOW-PLACEHOLDERS-NOT: -fallow-editor-placeholders504 505// RUN: %clang -### --target=x86_64-unknown-windows-msvc -fno-short-wchar %s 2>&1 | FileCheck -check-prefix CHECK-WINDOWS-ISO10646 %s506// CHECK-WINDOWS-ISO10646: "-fwchar-type=int"507// CHECK-WINDOWS-ISO10646: "-fsigned-wchar"508 509// RUN: %clang -### -S -fcf-protection %s 2>&1 | FileCheck -check-prefix=CHECK-CF-PROTECTION-FULL %s510// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CF-PROTECTION-FULL %s511// RUN: %clang -### -S -fcf-protection=full %s 2>&1 | FileCheck -check-prefix=CHECK-CF-PROTECTION-FULL %s512// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CF-PROTECTION-FULL %s513// CHECK-CF-PROTECTION-FULL: -fcf-protection=full514// CHECK-NO-CF-PROTECTION-FULL-NOT: -fcf-protection=full515// RUN: %clang -### -S -fcf-protection=return %s 2>&1 | FileCheck -check-prefix=CHECK-CF-PROTECTION-RETURN %s516// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CF-PROTECTION-RETURN %s517// CHECK-CF-PROTECTION-RETURN: -fcf-protection=return518// CHECK-NO-CF-PROTECTION-RETURN-NOT: -fcf-protection=return519// RUN: %clang -### -S -fcf-protection=branch %s 2>&1 | FileCheck -check-prefix=CHECK-CF-PROTECTION-BRANCH %s520// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CF-PROTECTION-BRANCH %s521// CHECK-CF-PROTECTION-BRANCH: -fcf-protection=branch522// CHECK-NO-CF-PROTECTION-BRANCH-NOT: -fcf-protection=branch523 524// RUN: %clang -### -S -fprofile-instr-generate -fcoverage-compilation-dir=. %s 2>&1 | FileCheck -check-prefix=CHECK-COVERAGE-COMPILATION-DIR %s525// RUN: %clang -### -S -fprofile-instr-generate -ffile-compilation-dir=. %s 2>&1 | FileCheck -check-prefix=CHECK-COVERAGE-COMPILATION-DIR %s526// CHECK-COVERAGE-COMPILATION-DIR: "-fcoverage-compilation-dir=."527// CHECK-COVERAGE-COMPILATION-DIR-NOT: "-ffile-compilation-dir=."528 529// RUN: %clang -### -S -fverify-intermediate-code %s 2>&1 | FileCheck -check-prefix=CHECK-VERIFY-INTERMEDIATE-CODE %s530// RUN: %clang -### -S -fno-verify-intermediate-code %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VERIFY-INTERMEDIATE-CODE %s531// CHECK-VERIFY-INTERMEDIATE-CODE-NOT: "-disable-llvm-verifier"532// CHECK-NO-VERIFY-INTERMEDIATE-CODE: "-disable-llvm-verifier"533 534// RUN: %clang -### -S -fdiscard-value-names %s 2>&1 | FileCheck -check-prefix=CHECK-DISCARD-NAMES %s535// RUN: %clang -### -S -fno-discard-value-names %s 2>&1 | FileCheck -check-prefix=CHECK-NO-DISCARD-NAMES %s536// CHECK-DISCARD-NAMES: "-discard-value-names"537// CHECK-NO-DISCARD-NAMES-NOT: "-discard-value-names"538 539// RUN: %clang -### -S -fdelete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NULL-POINTER-CHECKS %s540// RUN: %clang -### -S -fno-delete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NO-NULL-POINTER-CHECKS %s541// RUN: %clang -### -S -fdelete-null-pointer-checks -fno-delete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NO-NULL-POINTER-CHECKS %s542// RUN: %clang -### -S -fno-delete-null-pointer-checks -fdelete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NULL-POINTER-CHECKS %s543// CHECK-NO-NULL-POINTER-CHECKS: "-fno-delete-null-pointer-checks"544// CHECK-NULL-POINTER-CHECKS-NOT: "-fno-delete-null-pointer-checks"545 546// RUN: %clang -### -S --target=x86_64-unknown-linux -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s547// RUN: %clang -### -S --target=x86_64-unknown-linux -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s548// RUN: %clang -### -S --target=x86_64-unknown-linux -fno-record-gcc-switches -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s549// RUN: %clang -### -S --target=x86_64-unknown-linux -frecord-gcc-switches -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s550// RUN: %clang -### -S --target=x86_64-unknown-linux -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s551// RUN: %clang -### -S --target=x86_64-unknown-linux -fno-record-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s552// RUN: %clang -### -S --target=x86_64-unknown-linux -fno-record-command-line -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s553// RUN: %clang -### -S --target=x86_64-unknown-linux -frecord-command-line -fno-record-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s554// Test with a couple examples of non-ELF object file formats555// RUN: %clang -### -S --target=x86_64-unknown-macosx -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s556// RUN: not %clang -### -S --target=x86_64-unknown-windows -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES-ERROR %s557// CHECK-RECORD-GCC-SWITCHES: "-record-command-line"558// CHECK-NO-RECORD-GCC-SWITCHES-NOT: "-record-command-line"559// CHECK-RECORD-GCC-SWITCHES-ERROR: error: unsupported option '-frecord-command-line' for target560 561// RUN: %clang -### -S -ftrivial-auto-var-init=uninitialized %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-UNINIT %s562// RUN: %clang -### -S -ftrivial-auto-var-init=pattern %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-PATTERN %s563// RUN: %clang -### -S -ftrivial-auto-var-init=zero %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO %s564// CHECK-TRIVIAL-UNINIT-NOT: hasn't been enabled565// CHECK-TRIVIAL-PATTERN-NOT: hasn't been enabled566// CHECK-TRIVIAL-ZERO-NOT: hasn't been enabled567 568// RUN: %clang -### -S -ftrivial-auto-var-init=pattern -ftrivial-auto-var-init-stop-after=1 %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-PATTERN-STOP-AFTER %s569// RUN: %clang -### -S -ftrivial-auto-var-init=zero -ftrivial-auto-var-init-stop-after=1 %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO-STOP-AFTER %s570// RUN: not %clang -### -S -ftrivial-auto-var-init-stop-after=0 %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-STOP-AFTER-MISSING-DEPENDENCY %s571// RUN: not %clang -### -S -ftrivial-auto-var-init=pattern -ftrivial-auto-var-init-stop-after=0 %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-PATTERN-STOP-AFTER-INVALID-VALUE %s572// RUN: not %clang -### -S -ftrivial-auto-var-init=zero -ftrivial-auto-var-init-stop-after=0 %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO-STOP-AFTER-INVALID-VALUE %s573// CHECK-TRIVIAL-PATTERN-STOP-AFTER-NOT: is used without '-ftrivial-auto-var-init'574// CHECK-TRIVIAL-PATTERN-STOP-AFTER-NOT: only accepts positive integers575// CHECK-TRIVIAL-ZERO-STOP-AFTER-NOT: is used without '-ftrivial-auto-var-init'576// CHECK-TRIVIAL-ZERO-STOP-AFTER-NOT: only accepts positive integers577// CHECK-TRIVIAL-STOP-AFTER-MISSING-DEPENDENCY: used without '-ftrivial-auto-var-init=zero' or578// CHECK-TRIVIAL-PATTERN-STOP-AFTER-INVALID-VALUE: only accepts positive integers579// CHECK-TRIVIAL-ZERO-STOP-AFTER-INVALID-VALUE: only accepts positive integers580 581// RUN: %clang -### -S -ftrivial-auto-var-init=pattern -ftrivial-auto-var-init-max-size=1024 %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-PATTERN-MAX-SIZE %s582// RUN: %clang -### -S -ftrivial-auto-var-init=zero -ftrivial-auto-var-init-max-size=1024 %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO-MAX-SIZE %s583// RUN: not %clang -### -S -ftrivial-auto-var-init-max-size=1024 %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-MAX-SIZE-MISSING-DEPENDENCY %s584// RUN: not %clang -### -S -ftrivial-auto-var-init=pattern -ftrivial-auto-var-init-max-size=0 %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-PATTERN-MAX-SIZE-INVALID-VALUE %s585// RUN: not %clang -### -S -ftrivial-auto-var-init=zero -ftrivial-auto-var-init-max-size=0 %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO-MAX-SIZE-INVALID-VALUE %s586// CHECK-TRIVIAL-PATTERN-MAX-SIZE-NOT: is used without '-ftrivial-auto-var-init'587// CHECK-TRIVIAL-PATTERN-MAX-SIZE-NOT: only accepts positive integers (in bytes)588// CHECK-TRIVIAL-ZERO-MAX-SIZE-NOT: is used without '-ftrivial-auto-var-init'589// CHECK-TRIVIAL-ZERO-MAX-SIZE-NOT: only accepts positive integers (in bytes)590// CHECK-TRIVIAL-MAX-SIZE-MISSING-DEPENDENCY: used without '-ftrivial-auto-var-init=zero' or591// CHECK-TRIVIAL-PATTERN-MAX-SIZE-INVALID-VALUE: only accepts positive integers (in bytes)592// CHECK-TRIVIAL-ZERO-MAX-SIZE-INVALID-VALUE: only accepts positive integers (in bytes)593 594// RUN: %clang -### -S -fno-temp-file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-TEMP-FILE %s595// CHECK-NO-TEMP-FILE: "-fno-temp-file"596 597// RUN: %clang -### -xobjective-c -fobjc-disable-direct-methods-for-testing %s 2>&1 | FileCheck -check-prefix=CHECK_DISABLE_DIRECT %s598// RUN: %clang -### -xobjective-c %s 2>&1 | FileCheck -check-prefix=CHECK_NO_DISABLE_DIRECT %s599// CHECK_DISABLE_DIRECT: -fobjc-disable-direct-methods-for-testing600// CHECK_NO_DISABLE_DIRECT-NOT: -fobjc-disable-direct-methods-for-testing601 602// RUN: %clang -### -S -fjmc --target=x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefixes=CHECK_JMC_WARN,CHECK_NOJMC %s603// RUN: %clang -### -S -fjmc --target=x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefixes=CHECK_JMC_WARN,CHECK_NOJMC %s604// RUN: %clang -### -S -fjmc -g --target=x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_JMC %s605// RUN: %clang -### -S -fjmc -g -fno-jmc --target=x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC %s606// RUN: %clang -### -S -fjmc -g --target=x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_JMC %s607// RUN: %clang -### -S -fjmc -g -fno-jmc --target=x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC %s608// RUN: %clang -### -fjmc -g -flto -fuse-ld=lld --target=x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC_LTO %s609// RUN: %clang -### -fjmc -g -flto -fuse-ld=lld-link --target=x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC_LTO %s610// RUN: %clang -### -fjmc -g -flto --target=x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_JMC_LTO %s611// RUN: %clang -### -fjmc -g -flto -fno-jmc --target=x86_64-unknown-linux %s 2>&1 | FileCheck -check-prefix=CHECK_NOJMC_LTO %s612// CHECK_JMC_WARN: -fjmc requires debug info. Use -g or debug options that enable debugger's stepping function; option ignored613// CHECK_JMC_WARN_NOT_ELF: -fjmc works only for ELF; option ignored614// CHECK_NOJMC-NOT: -fjmc615// CHECK_JMC: -fjmc616// CHECK_NOJMC_LTO-NOT: -plugin-opt=-enable-jmc-instrument617// CHECK_JMC_LTO: -plugin-opt=-enable-jmc-instrument618 619// RUN: %clang -### -fintegrated-objemitter --target=x86_64 %s 2>&1 | FileCheck -check-prefix=CHECK-INT-OBJEMITTER %s620// CHECK-INT-OBJEMITTER-NOT: unsupported option '-fintegrated-objemitter' for target621// RUN: not %clang -### -fno-integrated-objemitter --target=x86_64 %s 2>&1 | FileCheck -check-prefix=CHECK-NOINT-OBJEMITTER %s622// CHECK-NOINT-OBJEMITTER: unsupported option '-fno-integrated-objemitter' for target623 624// RUN: %clang -### --target=aarch64-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MS-VOLATILE %s625// RUN: %clang -### --target=aarch64-windows-msvc -fms-volatile %s 2>&1 | FileCheck -check-prefix=CHECK-MS-VOLATILE %s626// RUN: %clang -### --target=aarch64-windows-msvc -fno-ms-volatile %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MS-VOLATILE %s627// RUN: %clang -### --target=x86_64-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK-MS-VOLATILE %s628// RUN: %clang -### --target=x86_64-windows-msvc -fno-ms-volatile %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MS-VOLATILE %s629// RUN: %clang -### --target=i686-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK-MS-VOLATILE %s630// RUN: %clang -### --target=i686-windows-msvc -fno-ms-volatile %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MS-VOLATILE %s631// CHECK-MS-VOLATILE: -fms-volatile632// CHECK-NO-MS-VOLATILE-NOT: -fms-volatile633 634// RUN: %clang -### --target=x86_64-pc-windows-msvc %s 2>&1 | FileCheck -check-prefix=CHECK-NO-STRICT-ALIASING %s635// RUN: %clang -### --target=x86_64-pc-windows-msvc -fstrict-aliasing %s 2>&1 | FileCheck -check-prefix=CHECK-STRICT-ALIASING %s636// RUN: %clang -### --target=x86_64-pc-windows-msvc -fno-strict-aliasing %s 2>&1 | FileCheck -check-prefix=CHECK-NO-STRICT-ALIASING %s637// CHECK-STRICT-ALIASING-NOT: -relaxed-aliasing638// CHECK-NO-STRICT-ALIASING: -relaxed-aliasing639