<div dir="ltr"><div class="gmail_extra">No, I don't think we still need that flag. It'd be more consistent to remove it along with the other deprecated sanitizer flags.</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Mar 20, 2014 at 3:53 AM, Alexey Samsonov <span dir="ltr"><<a href="mailto:samsonov@google.com" target="_blank">samsonov@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Do we still need -fbounds-checking flag? It's not documented in <a href="http://clang.llvm.org/docs/UsersManual.html" target="_blank">http://clang.llvm.org/docs/UsersManual.html</a>, for instance.</div>
<div class="gmail_extra">
<br><br><div class="gmail_quote"><div><div class="h5">On Fri, Oct 25, 2013 at 1:28 AM, Nuno Lopes <span dir="ltr"><<a href="mailto:nunoplopes@sapo.pt" target="_blank">nunoplopes@sapo.pt</a>></span> wrote:<br></div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Oct 23, 2013 at 2:58 PM, Nuno Lopes <<a href="mailto:nunoplopes@sapo.pt" target="_blank">nunoplopes@sapo.pt</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Let me disagree with this change:<br>
- I do not agree that '-fsanitize=local-bounds' is not a good compromise.<br>
It can detect overflows on globals, heap, and stack, including arbitrary<br>
pointer arithmetic, and therefore it subsumes '-fsanitize=array-bounds'.<br>
The advantage of the latter is that it produces nice diagnostics, while the<br>
former simply crashes the program when it detects an overflow. Therefore, I<br>
think there's value in keeping *both* instrumentations in<br>
-fsanitize=undefined.<br>
</blockquote>
<br>
<br>
Yes, there is value in keeping both. But that doesn't argue for keeping<br>
this check in -fsanitize=undefined specifically -- all the other checks in<br>
-fsanitize=undefined are pure frontend checks that check source language<br>
rules and give nice diagnostics. It doesn't fit there. And if you run with<br>
"-fsanitize=address,undefined"<u></u>, this particular check provides no value.<br>
(-fsanitize=array-bounds does provide in such a configuration value,<br>
because it checks the language model for pointer arithmetic, not the LLVM<br>
IR rules, and so can detect some issues that ASan misses;<br>
-fsanitize=local-bounds is a pure subset of ASan.)<br>
</blockquote>
<br></div>
'-fsanitize=local-bounds' is not a strict subset of ASan.  It is possible for ASan to miss certain overflows. It will catch the majority, but not all. It's possible that '-fsanitize=local-bounds' detects an overflow that ASan missed (and that valgrind misses).  Moreover, it does not require a runtime library (which is an advantage in certain use cases).<div>

<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Another issue is that local-bounds works by inserting a pass, which means<br>
that it does not work with LTO or in any other flow where the optimization<br>
passes are separated from IR emission.<br>
</blockquote>
<br></div>
It should work with LTO. It can be run whenever the optimizations are run.<br>
<br>
My biggest concern is that most people will continue using '-fsanitize=undefined' and will lose an important check that was previously enabled.<br>
Anyway, if this change is to be kept, the documentation needs to be updated.<br>
<br>
Nuno<br>
<br>
P.S.: BTW, the bug in the pass has been fixed in the meantime.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 BTW, '-fsanitize=local-bounds' properly inserts debug information in the<br>
trap, and therefore you can use a debugger to pinpoint the offending<br>
program statement.<br>
- '-fsanitize=local-bounds' does not have false positives by design.<br>
PR17653 is a bug which I'll fix soon.  This pass was designed to have zero<br>
false positives.<br>
- Also, I don't recall any previous discussion on this change..<br>
</blockquote>
<br>
Nuno<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<br>
----- Original Message ----- From: "Richard Smith" <<br>
<a href="mailto:richard-llvm@metafoo.co.uk" target="_blank">richard-llvm@metafoo.co.uk</a>><br>
Sent: Tuesday, October 22, 2013 11:51 PM<br>
Subject: r193205 - Split -fsanitize=bounds to -fsanitize=array-bounds (for<br>
thefrontend-inserted<br>
<br>
<br>
<br>
 Author: rsmith<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Date: Tue Oct 22 17:51:04 2013<br>
New Revision: 193205<br>
<br></div>
URL: <a href="http://llvm.org/viewvc/llvm-**project?rev=193205&view=rev" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project?rev=193205&view=rev</a><<a href="http://llvm.org/viewvc/llvm-project?rev=193205&view=rev" target="_blank">ht<u></u>tp://llvm.org/viewvc/llvm-<u></u>project?rev=193205&view=rev</a>><div>

<br>
Log:<br>
Split -fsanitize=bounds to -fsanitize=array-bounds (for the<br>
frontend-inserted<br>
check using the ubsan runtime) and -fsanitize=local-bounds (for the<br>
middle-end<br>
check which inserts traps).<br>
<br>
Remove -fsanitize=local-bounds from -fsanitize=undefined. It does not<br>
produce<br>
useful diagnostics and has false positives (PR17635), and is not a good<br>
compromise position between UBSan's checks and ASan's checks.<br>
<br>
Map -fbounds-checking to -fsanitize=local-bounds to restore Clang's<br>
historical<br>
behavior for that flag.<br>
<br>
Modified:<br></div>
   cfe/trunk/include/clang/Basic/<u></u>**Sanitizers.def<br>
   cfe/trunk/lib/CodeGen/**<u></u>BackendUtil.cpp<br>
   cfe/trunk/lib/CodeGen/CGExpr.*<u></u>*cpp<br>
   cfe/trunk/lib/CodeGen/**<u></u>CGExprScalar.cpp<br>
   cfe/trunk/lib/Driver/**<u></u>SanitizerArgs.cpp<br>
   cfe/trunk/test/CodeGen/bounds-<u></u>**checking.c<br>
   cfe/trunk/test/CodeGenCXX/**<u></u>catch-undef-behavior.cpp<br>
   cfe/trunk/test/Driver/bounds-*<u></u>*checking.c<br>
   cfe/trunk/test/Driver/**<u></u>fsanitize.c<br>
<br>
Modified: cfe/trunk/include/clang/Basic/<u></u>**Sanitizers.def<br>
URL: <a href="http://llvm.org/viewvc/llvm-**project/cfe/trunk/include/**" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project/cfe/trunk/include/**</a><br>
clang/Basic/Sanitizers.def?**<u></u>rev=193205&r1=193204&r2=**<u></u>193205&view=diff<<a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Sanitizers.def?rev=193205&r1=193204&r2=193205&view=diff" target="_blank">http://llvm.<u></u>org/viewvc/llvm-project/cfe/<u></u>trunk/include/clang/Basic/<u></u>Sanitizers.def?rev=193205&r1=<u></u>193204&r2=193205&view=diff</a>><br>


==============================<u></u>**============================<u></u>==**<br>
==================<br>
--- cfe/trunk/include/clang/Basic/<u></u>**Sanitizers.def (original)<br>
+++ cfe/trunk/include/clang/Basic/<u></u>**Sanitizers.def Tue Oct 22 17:51:04<div><br>
2013<br>
@@ -59,8 +59,8 @@ SANITIZER("leak", Leak)<br>
<br>
// UndefinedBehaviorSanitizer<br>
SANITIZER("alignment", Alignment)<br>
+SANITIZER("array-bounds", ArrayBounds)<br>
SANITIZER("bool", Bool)<br>
-SANITIZER("bounds", Bounds)<br>
SANITIZER("enum", Enum)<br></div>
SANITIZER("float-cast-**<u></u>overflow", FloatCastOverflow)<br>
SANITIZER("float-divide-by-**<u></u>zero", FloatDivideByZero)<div><br>
@@ -84,7 +84,7 @@ SANITIZER("dataflow", DataFlow)<br>
// -fsanitize=undefined includes all the sanitizers which have low<br>
overhead, no<br>
// ABI or address space layout implications, and only catch undefined<br>
behavior.<br>
SANITIZER_GROUP("undefined", Undefined,<br>
-                Alignment | Bool | Bounds | Enum | FloatCastOverflow |<br>
+                Alignment | Bool | ArrayBounds | Enum |<br>
FloatCastOverflow |<br>
                FloatDivideByZero | Function | IntegerDivideByZero | Null<br>
|<br>
                ObjectSize | Return | Shift | SignedIntegerOverflow |<br>
                Unreachable | VLABound | Vptr)<br>
@@ -94,7 +94,7 @@ SANITIZER_GROUP("undefined", Undefined,<br>
// runtime support.  This group is generally used in conjunction with the<br></div>
// -fsanitize-undefined-trap-on-*<u></u>*error flag.<br>
SANITIZER_GROUP("undefined-**<u></u>trap", UndefinedTrap,<div><br>
-                Alignment | Bool | Bounds | Enum | FloatCastOverflow |<br>
+                Alignment | Bool | ArrayBounds | Enum |<br>
FloatCastOverflow |<br>
                FloatDivideByZero | IntegerDivideByZero | Null |<br>
ObjectSize |<br>
                Return | Shift | SignedIntegerOverflow | Unreachable |<br>
                VLABound)<br>
@@ -103,5 +103,9 @@ SANITIZER_GROUP("integer", Integer,<br>
                SignedIntegerOverflow | UnsignedIntegerOverflow | Shift |<br>
                IntegerDivideByZero)<br>
<br>
+// -fbounds-checking<br>
+SANITIZER("local-bounds", LocalBounds)<br>
+SANITIZER_GROUP("bounds", Bounds, ArrayBounds | LocalBounds)<br>
+<br>
#undef SANITIZER<br>
#undef SANITIZER_GROUP<br>
<br></div>
Modified: cfe/trunk/lib/CodeGen/**<u></u>BackendUtil.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-**project/cfe/trunk/lib/CodeGen/**" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project/cfe/trunk/lib/CodeGen/<u></u>**</a><br>
BackendUtil.cpp?rev=193205&r1=<u></u>**193204&r2=193205&view=diff<<a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=193205&r1=193204&r2=193205&view=diff" target="_blank">h<u></u>ttp://llvm.org/viewvc/llvm-<u></u>project/cfe/trunk/lib/CodeGen/<u></u>BackendUtil.cpp?rev=193205&r1=<u></u>193204&r2=193205&view=diff</a>><br>


==============================<u></u>**============================<u></u>==**<br>
==================<br>
--- cfe/trunk/lib/CodeGen/**<u></u>BackendUtil.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/**<u></u>BackendUtil.cpp Tue Oct 22 17:51:04 2013<br>
@@ -245,7 +245,7 @@ void EmitAssemblyHelper::**<u></u>CreatePasses(Ta<br>
                           addObjCARCOptPass);<br>
  }<br>
<br>
-  if (LangOpts.Sanitize.Bounds) {<br>
+  if (LangOpts.Sanitize.**<u></u>LocalBounds) {<br>
    PMBuilder.addExtension(**<u></u>PassManagerBuilder::EP_**<br>
ScalarOptimizerLate,<br>
                           addBoundsCheckingPass);<br>
<br>
PMBuilder.addExtension(**<u></u>PassManagerBuilder::EP_**<u></u>EnabledOnOptLevel0,<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGExpr.*<u></u>*cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-**project/cfe/trunk/lib/CodeGen/**" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project/cfe/trunk/lib/CodeGen/<u></u>**</a><br>
CGExpr.cpp?rev=193205&r1=**<u></u>193204&r2=193205&view=diff<<a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=193205&r1=193204&r2=193205&view=diff" target="_blank">htt<u></u>p://llvm.org/viewvc/llvm-<u></u>project/cfe/trunk/lib/CodeGen/<u></u>CGExpr.cpp?rev=193205&r1=<u></u>193204&r2=193205&view=diff</a>><br>


==============================<u></u>**============================<u></u>==**<br>
==================<br>
--- cfe/trunk/lib/CodeGen/CGExpr.*<u></u>*cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGExpr.*<u></u>*cpp Tue Oct 22 17:51:04 2013<div><br>
@@ -641,7 +641,8 @@ static llvm::Value *getArrayIndexingBoun<br></div>
void CodeGenFunction::**<u></u>EmitBoundsCheck(const Expr *E, const Expr *Base,<div><br>
                                      llvm::Value *Index, QualType<br>
IndexType,<br>
                                      bool Accessed) {<br>
-  assert(SanOpts->Bounds && "should not be called unless adding bounds<br>
checks");<br>
+  assert(SanOpts->ArrayBounds &&<br>
+         "should not be called unless adding bounds checks");<br>
<br>
  QualType IndexedType;<br>
  llvm::Value *Bound = getArrayIndexingBound(*this, Base, IndexedType);<br></div>
@@ -742,7 +743,7 @@ LValue CodeGenFunction::**<u></u>EmitUnsupportedL<br>
<br>
LValue CodeGenFunction::**<u></u>EmitCheckedLValue(const Expr *E, TypeCheckKind<div><br>
TCK) {<br>
  LValue LV;<br>
-  if (SanOpts->Bounds && isa<ArraySubscriptExpr>(E))<br>
+  if (SanOpts->ArrayBounds && isa<ArraySubscriptExpr>(E))<br></div>
    LV = EmitArraySubscriptExpr(cast<**<u></u>ArraySubscriptExpr>(E),<div><br>
/*Accessed*/true);<br>
  else<br>
    LV = EmitLValue(E);<br></div>
@@ -2233,7 +2234,7 @@ LValue CodeGenFunction::**<u></u>EmitArraySubscri<div><br>
  QualType IdxTy  = E->getIdx()->getType();<br></div>
  bool IdxSigned = IdxTy->**<u></u>isSignedIntegerOrEnumerationTy<u></u>**pe();<div><br>
<br>
-  if (SanOpts->Bounds)<br>
+  if (SanOpts->ArrayBounds)<br>
    EmitBoundsCheck(E, E->getBase(), Idx, IdxTy, Accessed);<br>
<br>
  // If the base is a vector type, then we are forming a vector element<br>
lvalue<br>
<br></div>
Modified: cfe/trunk/lib/CodeGen/**<u></u>CGExprScalar.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-**project/cfe/trunk/lib/CodeGen/**" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project/cfe/trunk/lib/CodeGen/<u></u>**</a><br>
CGExprScalar.cpp?rev=193205&**<u></u>r1=193204&r2=193205&view=diff<<a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=193205&r1=193204&r2=193205&view=diff" target="_blank"><u></u>http://llvm.org/viewvc/llvm-<u></u>project/cfe/trunk/lib/CodeGen/<u></u>CGExprScalar.cpp?rev=193205&<u></u>r1=193204&r2=193205&view=diff</a>><br>


==============================<u></u>**============================<u></u>==**<br>
==================<br>
--- cfe/trunk/lib/CodeGen/**<u></u>CGExprScalar.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/**<u></u>CGExprScalar.cpp Tue Oct 22 17:51:04 2013<br>
@@ -1073,7 +1073,7 @@ Value *ScalarExprEmitter::**<u></u>VisitArraySubs<div><br>
  Value *Idx  = Visit(E->getIdx());<br>
  QualType IdxTy = E->getIdx()->getType();<br>
<br>
-  if (CGF.SanOpts->Bounds)<br>
+  if (CGF.SanOpts->ArrayBounds)<br>
    CGF.EmitBoundsCheck(E, E->getBase(), Idx, IdxTy, /*Accessed*/true);<br>
<br></div>
  bool IdxSigned = IdxTy->**<u></u>isSignedIntegerOrEnumerationTy<u></u>**pe();<div><br>
@@ -2314,7 +2314,7 @@ static Value *emitPointerArithmetic(Code<br>
  if (isSubtraction)<br>
    index = CGF.Builder.CreateNeg(index, "idx.neg");<br>
<br>
-  if (CGF.SanOpts->Bounds)<br>
+  if (CGF.SanOpts->ArrayBounds)<br>
    CGF.EmitBoundsCheck(op.E, pointerOperand, index,<br>
indexOperand->getType(),<br>
                        /*Accessed*/ false);<br>
<br>
<br></div>
Modified: cfe/trunk/lib/Driver/**<u></u>SanitizerArgs.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-**project/cfe/trunk/lib/Driver/**" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project/cfe/trunk/lib/Driver/*<u></u>*</a><br>
SanitizerArgs.cpp?rev=193205&*<u></u>*r1=193204&r2=193205&view=<u></u>diff<<a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=193205&r1=193204&r2=193205&view=diff" target="_blank">http://llvm.org/viewvc/<u></u>llvm-project/cfe/trunk/lib/<u></u>Driver/SanitizerArgs.cpp?rev=<u></u>193205&r1=193204&r2=193205&<u></u>view=diff</a>><br>


==============================<u></u>**============================<u></u>==**<br>
==================<br>
--- cfe/trunk/lib/Driver/**<u></u>SanitizerArgs.cpp (original)<br>
+++ cfe/trunk/lib/Driver/**<u></u>SanitizerArgs.cpp Tue Oct 22 17:51:04 2013<div><br>
@@ -256,8 +256,8 @@ bool SanitizerArgs::parse(const Driver &<br></div>
      "-fsanitize=undefined-trap -fsanitize-undefined-trap-on-*<u></u>*error";<br>
  } else if (A->getOption().matches(**<u></u>options::OPT_fbounds_checking) ||<br>
<br>
A->getOption().matches(**<u></u>options::OPT_fbounds_checking_<u></u>**EQ))<div><br>
{<br>
-    Add = Bounds;<br>
-    DeprecatedReplacement = "-fsanitize=bounds";<br>
+    Add = LocalBounds;<br>
+    DeprecatedReplacement = "-fsanitize=local-bounds";<br></div>
  } else if (A->getOption().matches(**<u></u>options::OPT_fsanitize_EQ)) {<div><br>
    Add = parse(D, A, DiagnoseErrors);<br></div>
  } else if (A->getOption().matches(**<u></u>options::OPT_fno_sanitize_EQ)) {<br>
<br>
Modified: cfe/trunk/test/CodeGen/bounds-<u></u>**checking.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-**project/cfe/trunk/test/**" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project/cfe/trunk/test/**</a><br>
CodeGen/bounds-checking.c?rev=<u></u>**193205&r1=193204&r2=193205&*<u></u>*view=diff<<a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/bounds-checking.c?rev=193205&r1=193204&r2=193205&view=diff" target="_blank">http://llvm.org/<u></u>viewvc/llvm-project/cfe/trunk/<u></u>test/CodeGen/bounds-checking.<u></u>c?rev=193205&r1=193204&r2=<u></u>193205&view=diff</a>><br>


==============================<u></u>**============================<u></u>==**<br>
==================<br>
--- cfe/trunk/test/CodeGen/bounds-<u></u>**checking.c (original)<br>
+++ cfe/trunk/test/CodeGen/bounds-<u></u>**checking.c Tue Oct 22 17:51:04 2013<div><br>
@@ -1,26 +1,29 @@<br>
-// RUN: %clang_cc1 -fsanitize=bounds -emit-llvm -triple<br>
x86_64-apple-darwin10 < %s | FileCheck %s<br>
+// RUN: %clang_cc1 -fsanitize=local-bounds -emit-llvm -triple<br>
x86_64-apple-darwin10 %s -o - | FileCheck %s<br>
+// RUN: %clang_cc1 -fsanitize=array-bounds -O<br></div>
-fsanitize-undefined-trap-on-*<u></u>*error -emit-llvm  -triple<div><div><br>
x86_64-apple-darwin10 -DNO_DYNAMIC %s -o - | FileCheck %s<br>
<br>
-// CHECK: @f<br>
+// CHECK-LABEL: @f<br>
double f(int b, int i) {<br>
  double a[b];<br>
-  // CHECK: trap<br>
+  // CHECK: call {{.*}} @llvm.trap<br>
  return a[i];<br>
}<br>
<br>
-// CHECK: @f2<br>
+// CHECK-LABEL: @f2<br>
void f2() {<br>
  // everything is constant; no trap possible<br>
-  // CHECK-NOT: trap<br>
+  // CHECK-NOT: call {{.*}} @llvm.trap<br>
  int a[2];<br>
  a[1] = 42;<br>
-<br>
+<br>
+#ifndef NO_DYNAMIC<br>
  short *b = malloc(64);<br>
  b[5] = *a + a[1] + 2;<br>
+#endif<br>
}<br>
<br>
-// CHECK: @f3<br>
+// CHECK-LABEL: @f3<br>
void f3() {<br>
  int a[1];<br>
-  // CHECK: trap<br>
+  // CHECK: call {{.*}} @llvm.trap<br>
  a[2] = 1;<br>
}<br>
<br></div></div>
Modified: cfe/trunk/test/CodeGenCXX/**<u></u>catch-undef-behavior.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-**project/cfe/trunk/test/**" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project/cfe/trunk/test/**</a><br>
CodeGenCXX/catch-undef-**<u></u>behavior.cpp?rev=193205&r1=**<br>
193204&r2=193205&view=diff<<a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/catch-undef-behavior.cpp?rev=193205&r1=193204&r2=193205&view=diff" target="_blank">htt<u></u>p://llvm.org/viewvc/llvm-<u></u>project/cfe/trunk/test/<u></u>CodeGenCXX/catch-undef-<u></u>behavior.cpp?rev=193205&r1=<u></u>193204&r2=193205&view=diff</a>><br>


==============================<u></u>**============================<u></u>==**<br>
==================<br>
--- cfe/trunk/test/CodeGenCXX/**<u></u>catch-undef-behavior.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/**<u></u>catch-undef-behavior.cpp Tue Oct 22<div><br>
17:51:04 2013<br>
@@ -1,4 +1,4 @@<br></div>
-// RUN: %clang_cc1 -std=c++11 -fsanitize=signed-integer-**<br>
overflow,integer-divide-by-**<u></u>zero,float-divide-by-zero,**<br>
shift,unreachable,return,vla-*<u></u>*bound,alignment,null,vptr,**<br>
object-size,float-cast-**<u></u>overflow,bool,enum,bounds,**<u></u>function<div><br>
 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s<br></div>
+// RUN: %clang_cc1 -std=c++11 -fsanitize=signed-integer-**<br>
overflow,integer-divide-by-**<u></u>zero,float-divide-by-zero,**<br>
shift,unreachable,return,vla-*<u></u>*bound,alignment,null,vptr,**<br>
object-size,float-cast-**<u></u>overflow,bool,enum,array-**<u></u>bounds,function<div><br>
 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s<br>
<br>
struct S {<br>
  double d;<br>
<br></div>
Modified: cfe/trunk/test/Driver/bounds-*<u></u>*checking.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-**project/cfe/trunk/test/Driver/**" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project/cfe/trunk/test/Driver/<u></u>**</a><br>
bounds-checking.c?rev=193205&*<u></u>*r1=193204&r2=193205&view=<u></u>diff<<a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/bounds-checking.c?rev=193205&r1=193204&r2=193205&view=diff" target="_blank">http://llvm.org/viewvc/<u></u>llvm-project/cfe/trunk/test/<u></u>Driver/bounds-checking.c?rev=<u></u>193205&r1=193204&r2=193205&<u></u>view=diff</a>><br>


==============================<u></u>**============================<u></u>==**<br>
==================<br>
--- cfe/trunk/test/Driver/bounds-*<u></u>*checking.c (original)<br>
+++ cfe/trunk/test/Driver/bounds-*<u></u>*checking.c Tue Oct 22 17:51:04 2013<div><br>
@@ -1,11 +1,11 @@<br>
// RUN: %clang -fsanitize=bounds -### -fsyntax-only %s 2> %t<br>
// RUN: FileCheck -check-prefix=CHECK < %t %s<br>
-// CHECK: "-fsanitize=bounds"<br></div>
+// CHECK: "-fsanitize=array-bounds,**<u></u>local-bounds"<div><br>
<br>
// RUN: %clang -fbounds-checking -### -fsyntax-only %s 2> %t<br>
// RUN: FileCheck -check-prefix=CHECK-OLD < %t %s<br>
-// CHECK-OLD: "-fsanitize=bounds"<br>
+// CHECK-OLD: "-fsanitize=local-bounds"<br>
<br>
// RUN: %clang -fbounds-checking=3 -### -fsyntax-only %s 2> %t<br>
// RUN: FileCheck -check-prefix=CHECK-OLD2 < %t %s<br>
-// CHECK-OLD2: "-fsanitize=bounds"<br>
+// CHECK-OLD2: "-fsanitize=local-bounds"<br>
<br></div>
Modified: cfe/trunk/test/Driver/**<u></u>fsanitize.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-**project/cfe/trunk/test/Driver/**" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project/cfe/trunk/test/Driver/<u></u>**</a><br>
fsanitize.c?rev=193205&r1=**<u></u>193204&r2=193205&view=diff<<a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fsanitize.c?rev=193205&r1=193204&r2=193205&view=diff" target="_blank">htt<u></u>p://llvm.org/viewvc/llvm-<u></u>project/cfe/trunk/test/Driver/<u></u>fsanitize.c?rev=193205&r1=<u></u>193204&r2=193205&view=diff</a>><br>


==============================<u></u>**============================<u></u>==**<br>
==================<br>
--- cfe/trunk/test/Driver/**<u></u>fsanitize.c (original)<br>
+++ cfe/trunk/test/Driver/**<u></u>fsanitize.c Tue Oct 22 17:51:04 2013<div><br>
@@ -1,17 +1,17 @@<br>
// RUN: %clang -target x86_64-linux-gnu -fcatch-undefined-behavior %s<br></div>
-### 2>&1 | FileCheck %s --check-prefix=CHECK-**<u></u>UNDEFINED-TRAP<div><br>
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined-trap<br></div>
-fsanitize-undefined-trap-on-*<u></u>*error %s -### 2>&1 | FileCheck %s<br>
--check-prefix=CHECK-**<u></u>UNDEFINED-TRAP<br>
// RUN: %clang -target x86_64-linux-gnu -fsanitize-undefined-trap-on-*<u></u>*error<div><br>
-fsanitize=undefined-trap %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-<br></div>
**UNDEFINED-TRAP<br>
-// CHECK-UNDEFINED-TRAP: "-fsanitize={{((signed-**<br>
integer-overflow|integer-**<u></u>divide-by-zero|float-divide-**<br>
by-zero|shift|unreachable|**<u></u>return|vla-bound|alignment|**<br>
null|object-size|float-cast-**<u></u>overflow|bounds|enum|bool),?){<u></u>**14}"}}<br>
+// CHECK-UNDEFINED-TRAP: "-fsanitize={{((signed-**<br>
integer-overflow|integer-**<u></u>divide-by-zero|float-divide-**<br>
by-zero|shift|unreachable|**<u></u>return|vla-bound|alignment|**<br>
null|object-size|float-cast-**<u></u>overflow|array-bounds|enum|**<br>
bool),?){14}"}}<br>
// CHECK-UNDEFINED-TRAP: "-fsanitize-undefined-trap-on-<u></u>**error"<div><br>
<br>
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined %s -### 2>&1<br>
| FileCheck %s --check-prefix=CHECK-UNDEFINED<br></div>
-// CHECK-UNDEFINED: "-fsanitize={{((signed-**<u></u>integer-overflow|integer-**<br>
divide-by-zero|float-divide-**<u></u>by-zero|function|shift|**<br>
unreachable|return|vla-bound|*<u></u>*alignment|null|vptr|object-**<br>
size|float-cast-overflow|**<u></u>bounds|enum|bool),?){16}"}}<br>
+// CHECK-UNDEFINED: "-fsanitize={{((signed-**<u></u>integer-overflow|integer-**<br>
divide-by-zero|float-divide-**<u></u>by-zero|function|shift|**<br>
unreachable|return|vla-bound|*<u></u>*alignment|null|vptr|object-**<br>
size|float-cast-overflow|**<u></u>array-bounds|enum|bool),?){16}<u></u>**"}}<div><br>
<br>
// RUN: %clang -target x86_64-linux-gnu -fsanitize=integer %s -### 2>&1 |<br>
FileCheck %s --check-prefix=CHECK-INTEGER<br></div>
// CHECK-INTEGER: "-fsanitize={{((signed-**<u></u>integer-overflow|unsigned-**<br>
integer-overflow|integer-**<u></u>divide-by-zero|shift),?){4}"}}<div><br>
<br>
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,undefined<br></div>
-fno-thread-sanitizer -fno-sanitize=float-cast-**<u></u>overflow,vptr,bool,enum<br>
%s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-*<u></u>*UNDEFINED<br>
-// CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-**<br>
integer-overflow|integer-**<u></u>divide-by-zero|float-divide-**<br>
by-zero|function|shift|**<u></u>unreachable|return|vla-bound|*<u></u>*<br>
alignment|null|object-size|**<u></u>bounds),?){12}"}}<br>
+// CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-**<br>
integer-overflow|integer-**<u></u>divide-by-zero|float-divide-**<br>
by-zero|function|shift|**<u></u>unreachable|return|vla-bound|*<u></u>*<br>
alignment|null|object-size|**<u></u>array-bounds),?){12}"}}<div><br>
<br>
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address-full %s -###<br>
2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FULL<br></div>
// CHECK-ASAN-FULL: "-fsanitize={{((address|init-*<u></u>*<br>
order|use-after-return|use-**<u></u>after-scope),?){4}"}}<div><br>
@@ -101,7 +101,7 @@<br>
// CHECK-DEPRECATED: argument '-fno-thread-sanitizer' is deprecated, use<br>
'-fno-sanitize=thread' instead<br>
// CHECK-DEPRECATED: argument '-faddress-sanitizer' is deprecated, use<br>
'-fsanitize=address' instead<br>
// CHECK-DEPRECATED: argument '-fno-address-sanitizer' is deprecated, use<br>
'-fno-sanitize=address' instead<br>
-// CHECK-DEPRECATED: argument '-fbounds-checking' is deprecated, use<br>
'-fsanitize=bounds' instead<br>
+// CHECK-DEPRECATED: argument '-fbounds-checking' is deprecated, use<br>
'-fsanitize=local-bounds' instead<br>
<br>
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 |<br></div>
FileCheck %s --check-prefix=CHECK-TSAN-NO-*<u></u>*PIE<div><br>
// CHECK-TSAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2"<br>
"-pie-level" "2" <br>
</div></blockquote></blockquote></blockquote></div></div><div><div>
<br><div class="">
______________________________<u></u>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
</div></div></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</font></span></div>
</blockquote></div><br></div></div>