39 lines · cpp
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,CHECK3// 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,CHECK5// 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,CHECK7// 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,CHECK9// 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,CHECK11 12void bar(int x) {13}14 15// CLEAN: define dso_local void @_Z3bari(i32 %x) #0 {16// NOUNDEF: define dso_local void @_Z3bari(i32 noundef %x) #0 {17// CLEAN: @__msan_param_tls18// NOUNDEF_ONLY: @__msan_param_tls19// EAGER-NOT: @__msan_param_tls20// CHECK: }21 22int foo() {23 return 1;24}25 26// CLEAN: define dso_local i32 @_Z3foov() #0 {27// NOUNDEF: define dso_local noundef i32 @_Z3foov() #0 {28// CLEAN: @__msan_retval_tls29// NOUNDEF_ONLY: @__msan_retval_tls30// EAGER-NOT: @__msan_retval_tls31// CHECK: }32 33int noret() {34}35 36// CLEAN: define dso_local i32 @_Z5noretv() #0 {37// NOUNDEF: define dso_local noundef i32 @_Z5noretv() #0 {38// CHECK: unreachable39// CHECK: }