| 1 |
// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -no-enable-noundef-analysis -o - %s | \ |
| 2 |
// RUN: FileCheck %s --check-prefixes=CLEAN,CHECK |
| 3 |
// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -fno-sanitize-memory-param-retval -o - %s | \ |
| 4 |
// RUN: FileCheck %s --check-prefixes=NOUNDEF,NOUNDEF_ONLY,CHECK |
| 5 |
// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -mllvm -msan-eager-checks -o - %s | \ |
| 6 |
// RUN: FileCheck %s --check-prefixes=NOUNDEF,EAGER,CHECK |
| 7 |
// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -no-enable-noundef-analysis -fsanitize-memory-param-retval -o - %s | \ |
| 8 |
// RUN: FileCheck %s --check-prefixes=CLEAN,CHECK |
| 9 |
// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -o - %s | \ |
| 10 |
// RUN: FileCheck %s --check-prefixes=NOUNDEF,EAGER,CHECK |
| 11 |
|
| 12 |
void bar(int x) { |
| 13 |
} |
| 14 |
|
| 15 |
// CLEAN: define dso_local void @bar(i32 %x) #0 { |
| 16 |
// NOUNDEF: define dso_local void @bar(i32 noundef %x) #0 { |
| 17 |
// CLEAN: @__msan_param_tls |
| 18 |
// NOUNDEF_ONLY: @__msan_param_tls |
| 19 |
// EAGER-NOT: @__msan_param_tls |
| 20 |
// CHECK: } |
| 21 |
|
| 22 |
int foo() { |
| 23 |
return 1; |
| 24 |
} |
| 25 |
|
| 26 |
// CLEAN: define dso_local i32 @foo() #0 { |
| 27 |
// NOUNDEF: define dso_local noundef i32 @foo() #0 { |
| 28 |
// CLEAN: @__msan_retval_tls |
| 29 |
// NOUNDEF_ONLY: @__msan_retval_tls |
| 30 |
// EAGER-NOT: @__msan_retval_tls |
| 31 |
// CHECK: } |
| 32 |
|
| 33 |
int noret() { |
| 34 |
} |
| 35 |
|
| 36 |
// CLEAN: define dso_local i32 @noret() #0 { |
| 37 |
// NOUNDEF: define dso_local noundef i32 @noret() #0 { |
| 38 |
// CHECK: %retval = alloca |
| 39 |
// CLEAN: @__msan_retval_tls |
| 40 |
// NOUNDEF_ONLY: @__msan_retval_tls |
| 41 |
// EAGER-NOT: @__msan_retval_tls |
| 42 |
// CHECK: } |