[test][msan] Update for noundef on retval
GitOrigin-RevId: e92fe7af3f9d7a660e026912852c8ce401331c03
diff --git a/test/msan/stack-origin2.cpp b/test/msan/stack-origin2.cpp
index f47a393..1c9d66a 100644
--- a/test/msan/stack-origin2.cpp
+++ b/test/msan/stack-origin2.cpp
@@ -20,17 +20,19 @@
#include <stdlib.h>
-extern "C"
-int f(int depth) {
- if (depth) return f(depth - 1);
+int t;
- int x;
- int *volatile p = &x;
- return *p;
+extern "C" void f(int depth) {
+ if (depth)
+ return f(depth - 1);
+
+ volatile int x;
+ t = x;
}
int main(int argc, char **argv) {
- return f(1);
+ f(1);
+ return t;
// CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
// CHECK: {{#0 0x.* in main .*stack-origin2.cpp:}}[[@LINE-2]]