llvm/clang/test/Driver/fsanitize-address-destructor.c
Dan Liew 2d42b2ee7b [ASan] Rename -fsanitize-address-destructor-kind= to drop the -kind suffix.
Renaming the option is based on discussions in https://reviews.llvm.org/D101122.

It is normally not a good idea to rename driver flags but this flag is
new enough and obscure enough that it is very unlikely to have adopters.

While we're here also drop the `<kind>` metavar. It's not necessary and
is actually inconsistent with the documentation in
`clang/docs/ClangCommandLineReference.rst`.

Differential Revision: https://reviews.llvm.org/D101491
2021-04-29 11:55:42 -07:00

21 lines
1,018 B
C

// Option should not be passed to the frontend by default.
// RUN: %clang -target x86_64-apple-macosx10.15-gnu -fsanitize=address %s \
// RUN: -### 2>&1 | \
// RUN: FileCheck %s
// CHECK-NOT: -fsanitize-address-destructor
// RUN: %clang -target x86_64-apple-macosx10.15-gnu -fsanitize=address \
// RUN: -fsanitize-address-destructor=none %s -### 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-NONE-ARG %s
// CHECK-NONE-ARG: "-fsanitize-address-destructor=none"
// RUN: %clang -target x86_64-apple-macosx10.15-gnu -fsanitize=address \
// RUN: -fsanitize-address-destructor=global %s -### 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-GLOBAL-ARG %s
// CHECK-GLOBAL-ARG: "-fsanitize-address-destructor=global"
// RUN: %clang -target x86_64-apple-macosx10.15-gnu -fsanitize=address \
// RUN: -fsanitize-address-destructor=bad_arg %s -### 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-INVALID-ARG %s
// CHECK-INVALID-ARG: error: unsupported argument 'bad_arg' to option 'fsanitize-address-destructor='