2017-08-02 15:20:27 +08:00
|
|
|
// Test for the --autocompletion flag, which is an API used for shell
|
|
|
|
// autocompletion. You may have to update tests in this file when you
|
|
|
|
// add/modify flags, change HelpTexts or the values of some flags.
|
|
|
|
|
2017-09-05 20:41:00 +08:00
|
|
|
// Some corner cases.
|
|
|
|
// Just test that this doesn't crash:
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=
|
2017-09-05 20:41:00 +08:00
|
|
|
// RUN: %clang --autocomplete=,
|
|
|
|
// RUN: %clang --autocomplete==
|
|
|
|
// RUN: %clang --autocomplete=,,
|
|
|
|
// RUN: %clang --autocomplete=-
|
|
|
|
|
2017-05-24 02:39:08 +08:00
|
|
|
// RUN: %clang --autocomplete=-fsyn | FileCheck %s -check-prefix=FSYN
|
|
|
|
// FSYN: -fsyntax-only
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-std | FileCheck %s -check-prefix=STD
|
2017-07-26 21:36:58 +08:00
|
|
|
// STD: -std= Language standard to compile for
|
2017-06-22 00:50:38 +08:00
|
|
|
// RUN: %clang --autocomplete=foo | FileCheck %s -check-prefix=FOO
|
|
|
|
// FOO-NOT: foo
|
2017-06-21 00:31:31 +08:00
|
|
|
// RUN: %clang --autocomplete=-stdlib=,l | FileCheck %s -check-prefix=STDLIB
|
2017-07-26 21:36:58 +08:00
|
|
|
// STDLIB: libc++
|
|
|
|
// STDLIB-NEXT: libstdc++
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-stdlib= | FileCheck %s -check-prefix=STDLIBALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// STDLIBALL: libc++
|
|
|
|
// STDLIBALL-NEXT: libstdc++
|
|
|
|
// STDLIBALL-NEXT: platform
|
2017-06-21 00:31:31 +08:00
|
|
|
// RUN: %clang --autocomplete=-meabi,d | FileCheck %s -check-prefix=MEABI
|
|
|
|
// MEABI: default
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-meabi | FileCheck %s -check-prefix=MEABIALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// MEABIALL: 4
|
|
|
|
// MEABIALL-NEXT: 5
|
|
|
|
// MEABIALL-NEXT: default
|
|
|
|
// MEABIALL-NEXT: gnu
|
2017-06-21 00:31:31 +08:00
|
|
|
// RUN: %clang --autocomplete=-cl-std=,CL2 | FileCheck %s -check-prefix=CLSTD
|
|
|
|
// CLSTD: CL2.0
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-cl-std= | FileCheck %s -check-prefix=CLSTDALL
|
2018-04-12 22:17:04 +08:00
|
|
|
// CLSTDALL: c++
|
|
|
|
// CLSTDALL-NEXT: cl
|
2017-07-26 21:36:58 +08:00
|
|
|
// CLSTDALL-NEXT: CL
|
|
|
|
// CLSTDALL-NEXT: cl1.1
|
|
|
|
// CLSTDALL-NEXT: CL1.1
|
|
|
|
// CLSTDALL-NEXT: cl1.2
|
|
|
|
// CLSTDALL-NEXT: CL1.2
|
|
|
|
// CLSTDALL-NEXT: cl2.0
|
|
|
|
// CLSTDALL-NEXT: CL2.0
|
2017-06-21 00:31:31 +08:00
|
|
|
// RUN: %clang --autocomplete=-fno-sanitize-coverage=,f | FileCheck %s -check-prefix=FNOSANICOVER
|
|
|
|
// FNOSANICOVER: func
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-fno-sanitize-coverage= | FileCheck %s -check-prefix=FNOSANICOVERALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// FNOSANICOVERALL: 8bit-counters
|
|
|
|
// FNOSANICOVERALL-NEXT: bb
|
|
|
|
// FNOSANICOVERALL-NEXT: edge
|
|
|
|
// FNOSANICOVERALL-NEXT: func
|
|
|
|
// FNOSANICOVERALL-NEXT: indirect-calls
|
|
|
|
// FNOSANICOVERALL-NEXT: inline-8bit-counters
|
|
|
|
// FNOSANICOVERALL-NEXT: no-prune
|
|
|
|
// FNOSANICOVERALL-NEXT: trace-bb
|
|
|
|
// FNOSANICOVERALL-NEXT: trace-cmp
|
|
|
|
// FNOSANICOVERALL-NEXT: trace-div
|
|
|
|
// FNOSANICOVERALL-NEXT: trace-gep
|
|
|
|
// FNOSANICOVERALL-NEXT: trace-pc
|
|
|
|
// FNOSANICOVERALL-NEXT: trace-pc-guard
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-ffp-contract= | FileCheck %s -check-prefix=FFPALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// FFPALL: fast
|
|
|
|
// FFPALL-NEXT: off
|
|
|
|
// FFPALL-NEXT: on
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-flto= | FileCheck %s -check-prefix=FLTOALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// FLTOALL: full
|
|
|
|
// FLTOALL-NEXT: thin
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-fveclib= | FileCheck %s -check-prefix=FVECLIBALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// FVECLIBALL: Accelerate
|
|
|
|
// FVECLIBALL-NEXT: none
|
|
|
|
// FVECLIBALL-NEXT: SVML
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-fshow-overloads= | FileCheck %s -check-prefix=FSOVERALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// FSOVERALL: all
|
|
|
|
// FSOVERALL-NEXT: best
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-fvisibility= | FileCheck %s -check-prefix=FVISIBILITYALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// FVISIBILITYALL: default
|
|
|
|
// FVISIBILITYALL-NEXT: hidden
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-mfloat-abi= | FileCheck %s -check-prefix=MFLOATABIALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// MFLOATABIALL: hard
|
|
|
|
// MFLOATABIALL-NEXT: soft
|
|
|
|
// MFLOATABIALL-NEXT: softfp
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-mthread-model | FileCheck %s -check-prefix=MTHREADMODELALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// MTHREADMODELALL: posix
|
|
|
|
// MTHREADMODELALL-NEXT: single
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-mrelocation-model | FileCheck %s -check-prefix=MRELOCMODELALL
|
2017-07-26 21:36:58 +08:00
|
|
|
// MRELOCMODELALL: dynamic-no-pic
|
|
|
|
// MRELOCMODELALL-NEXT: pic
|
|
|
|
// MRELOCMODELALL-NEXT: ropi
|
|
|
|
// MRELOCMODELALL-NEXT: ropi-rwpi
|
|
|
|
// MRELOCMODELALL-NEXT: rwpi
|
|
|
|
// MRELOCMODELALL-NEXT: static
|
2017-07-16 23:07:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-Wma | FileCheck %s -check-prefix=WARNING
|
2017-07-26 21:36:58 +08:00
|
|
|
// WARNING: -Wmacro-redefined
|
|
|
|
// WARNING-NEXT: -Wmain
|
|
|
|
// WARNING-NEXT: -Wmain-return-type
|
|
|
|
// WARNING-NEXT: -Wmalformed-warning-check
|
|
|
|
// WARNING-NEXT: -Wmany-braces-around-scalar-init
|
|
|
|
// WARNING-NEXT: -Wmax-unsigned-zero
|
2017-07-22 20:35:15 +08:00
|
|
|
// RUN: %clang --autocomplete=-Wno-invalid-pp- | FileCheck %s -check-prefix=NOWARNING
|
|
|
|
// NOWARNING: -Wno-invalid-pp-token
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-analyzer-checker | FileCheck %s -check-prefix=ANALYZER
|
2017-08-29 08:09:31 +08:00
|
|
|
// ANALYZER: unix.Malloc
|
2018-03-05 16:54:20 +08:00
|
|
|
// RUN: %clang --autocomplete=-std= | FileCheck %s -check-prefix=STDVAL
|
2017-08-29 10:01:56 +08:00
|
|
|
// STDVAL: c99
|
2018-03-05 16:54:20 +08:00
|
|
|
//
|
|
|
|
// Clang shouldn't autocomplete CC1 options unless -cc1 or -Xclang were provided
|
|
|
|
// RUN: %clang --autocomplete=-mrelocation-mode | FileCheck %s -check-prefix=MRELOCMODEL_CLANG
|
|
|
|
// MRELOCMODEL_CLANG-NOT: -mrelocation-model
|
|
|
|
// RUN: %clang --autocomplete=-Xclang,-mrelocation-mode | FileCheck %s -check-prefix=MRELOCMODEL_CC1
|
|
|
|
// RUN: %clang --autocomplete=-cc1,-mrelocation-mode | FileCheck %s -check-prefix=MRELOCMODEL_CC1
|
|
|
|
// MRELOCMODEL_CC1: -mrelocation-model
|
|
|
|
// Make sure it ignores passed flags unlesss they are -Xclang or -cc1
|
|
|
|
// RUN: %clang --autocomplete=foo,bar,,-fsyn | FileCheck %s -check-prefix=FSYN-CORON
|
|
|
|
// FSYN-CORON: -fsyntax-only
|
|
|
|
// Check if they can autocomplete values with coron
|
|
|
|
// RUN: %clang --autocomplete=foo,bar,,,-fno-sanitize-coverage=,f | FileCheck %s -check-prefix=FNOSANICOVER-CORON
|
|
|
|
// FNOSANICOVER-CORON: func
|