Skip to content

Commit

Permalink
Make ASan and fuzzer test slightly more complex, such that LLVM18 als…
Browse files Browse the repository at this point in the history
…o emits the expected code (seems to optimize away some things for very simple code).
  • Loading branch information
JohanEngelen authored and kinke committed Mar 28, 2024
1 parent 3cc3d3c commit 068285e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/sanitizers/fsanitize_address.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
// RUN: %ldc -c -output-ll -g -fsanitize=address,thread -of=%t.tsan.ll %s && FileCheck %s --check-prefix=wTSAN < %t.tsan.ll
// RUN: %ldc -c -output-ll -g -fsanitize=address -fsanitize=thread -of=%t.tsan.ll %s && FileCheck %s --check-prefix=wTSAN < %t.tsan.ll

void foo() {
void foo(size_t a) {
// wTSAN: call {{.*}}_tsan_func_entry
// CHECK: call {{.*}}_asan_stack_malloc
// wTSAN: {{(call|invoke)}} {{.*}}_asan_stack_malloc
int[10] i;
// CHECK: call {{.*}}_asan_report_store
// wTSAN: {{(call|invoke)}} {{.*}}_asan_report_store
i[0] = 1;
i[a] = 1;
}
3 changes: 2 additions & 1 deletion tests/sanitizers/fsanitize_fuzzer.d
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ bool FuzzMe(const ubyte* data, size_t dataSize)
}

// CHECK-LABEL: define{{.*}} @{{.*}}allocInt
void allocInt() {
void allocInt(size_t i) {
// wASAN: call {{.*}}_asan_stack_malloc
int[10] a;
a[i] = 1;
}

// CHECK-LABEL: define{{.*}} @{{.*}}foo
Expand Down

0 comments on commit 068285e

Please sign in to comment.