And handle help=1 in standalone LSan.
llvm-svn: 226438
OverrideCommonFlags(cf);
}
+ bool help_before = common_flags()->help;
+
const char *options = GetEnv("LSAN_OPTIONS");
parser.ParseString(options);
+
+ if (!help_before && common_flags()->help)
+ parser.PrintFlagDescriptions();
}
#define LOG_POINTERS(...) \
+++ /dev/null
-// RUN: %clangxx_asan -O0 %s -o %t
-// RUN: echo -e "symbolize=1\ninclude='%t.options2.txt'" >%t.options1.txt
-// RUN: echo -e "verbosity=1\n" >%t.options2.txt
-// RUN: cat %t.options1.txt
-// RUN: cat %t.options2.txt
-// RUN: ASAN_OPTIONS="verbosity=0:include='%t.options1.txt'" %run %t 2>&1 | tee %t.out
-// RUN: FileCheck %s --check-prefix=CHECK-VERBOSITY1 <%t.out
-// RUN: ASAN_OPTIONS="include='%t.options1.txt',verbosity=0" %run %t 2>&1 | tee %t.out
-// RUN: FileCheck %s --check-prefix=CHECK-VERBOSITY0 <%t.out
-// RUN: ASAN_OPTIONS="include='%t.options-not-found.txt',verbosity=0" not %run %t 2>&1 | tee %t.out
-// RUN: FileCheck %s --check-prefix=CHECK-NOT-FOUND < %t.out
-
-#include <stdio.h>
-
-int main() {
- fprintf(stderr, "done\n");
-}
-
-// CHECK-VERBOSITY1: Parsed ASAN_OPTIONS:
-// CHECK-VERBOSITY0-NOT: Parsed ASAN_OPTIONS:
-// CHECK-NOT-FOUND: Failed to read options from
+++ /dev/null
-// RUN: %clangxx_asan -O0 %s -o %t
-// RUN: ASAN_OPTIONS=invalid_option_name=10 not %run %t 2>&1 | FileCheck %s
-
-int main() {
-}
-
-// CHECK: Unknown flag{{.*}}invalid_option_name
--- /dev/null
+// RUN: %clangxx -O0 %s -o %t
+// RUN: %tool_options=help=1 %run %t 2>&1 | FileCheck %s
+
+int main() {
+}
+
+// CHECK: Available flags for {{.*}}Sanitizer:
+// CHECK: handle_segv
--- /dev/null
+// RUN: %clangxx -O0 %s -o %t
+// RUN: echo -e "symbolize=1\ninclude='%t.options2.txt'" >%t.options1.txt
+// RUN: echo -e "help=1\n" >%t.options2.txt
+// RUN: cat %t.options1.txt
+// RUN: cat %t.options2.txt
+// RUN: %tool_options="help=0:include='%t.options1.txt'" %run %t 2>&1 | tee %t.out
+// RUN: FileCheck %s --check-prefix=CHECK-VERBOSITY1 <%t.out
+// RUN: %tool_options="include='%t.options1.txt',help=0" %run %t 2>&1 | tee %t.out
+// RUN: FileCheck %s --check-prefix=CHECK-VERBOSITY0 <%t.out
+// RUN: %tool_options="include='%t.options-not-found.txt',help=1" not %run %t 2>&1 | tee %t.out
+// RUN: FileCheck %s --check-prefix=CHECK-NOT-FOUND < %t.out
+
+#include <stdio.h>
+
+int main() {
+ fprintf(stderr, "done\n");
+}
+
+// CHECK-VERBOSITY1: Available flags for
+// CHECK-VERBOSITY0-NOT: Available flags for
+// CHECK-NOT-FOUND: Failed to read options from
--- /dev/null
+// RUN: %clangxx -O0 %s -o %t
+// RUN: %tool_options=invalid_option_name=10 not %run %t 2>&1 | FileCheck %s
+
+int main() {
+}
+
+// CHECK: Unknown flag{{.*}}invalid_option_name