[compiler-rt] [HWASAN] Add test to detected use after free in memcmp (PR #67204)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 17:23:52 PDT 2023


================
@@ -0,0 +1,20 @@
+// RUN: %clangxx_hwasan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_hwasan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_hwasan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_hwasan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
+
+// REQUIRES: compiler-rt-optimized
+
+// FIXME: we need to implement memcmp intercepptor to make this work.
+// UNSUPPORTED: hwasan
+
+#include <string.h>
+int main(int argc, char **argv) {
+  char a1[] = {static_cast<char>(argc), 2, 3, 4};
----------------
vitalybuka wrote:

builder unhappy https://github.com/llvm/llvm-project/actions/runs/6280283712/job/17057273713

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


More information about the llvm-commits mailing list