[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / compiler-rt / test / hwasan / TestCases / abort-message-android.cpp
blobf89b929d454d4594d58916a52877d826ee3b5a99
1 // RUN: %clangxx_hwasan -DERR=1 %s -o %t && not %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_hwasan -DERR=2 %s -o %t && not %run %t 2>&1 | FileCheck %s
3 // REQUIRES: android
5 #include <stdlib.h>
6 #include <stdio.h>
8 #include <sanitizer/hwasan_interface.h>
10 __attribute__((no_sanitize("hwaddress")))
11 extern "C" void android_set_abort_message(const char *msg) {
12 fprintf(stderr, "== abort message start\n%s\n== abort message end\n", msg);
15 int main() {
16 __hwasan_enable_allocator_tagging();
17 char *volatile p = (char *)malloc(16);
18 if (ERR==1) {
19 p[16] = 1;
20 } else {
21 free(p);
22 free(p);
24 // CHECK: ERROR: HWAddressSanitizer:
25 // CHECK: == abort message start
26 // CHECK: ERROR: HWAddressSanitizer:
27 // CHECK: == abort message end