[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 3 10:42:44 PDT 2023


================
@@ -0,0 +1,12 @@
+// This reports a warning to follow the default behavior of ClangAs.
+// RUN: %clang -fexperimental-bounds-safety -x assembler -c %s -o /dev/null 2>&1 | FileCheck -check-prefix WARN %s
+
+
+// WARN: warning: argument unused during compilation: '-fexperimental-bounds-safety'
+
+// expected-no-diagnostics
+// RUN: %clang -fexperimental-bounds-safety -Xclang -verify -c -x c %s -o /dev/null
+// Unlike '-x assembler', '-x assembler-with-cpp' silently ignores unused options by default.
+// XXX: Should report a targeted warning in future when assembler tries to use preprocessor directives to conditionalize behavior when bounds safety is enabled.
----------------
rapidsna wrote:

@delcypher Perfect, thanks!

https://github.com/llvm/llvm-project/pull/70480


More information about the cfe-commits mailing list