[compiler-rt] [compiler-rt][test]Simplify instrprof-vtable-value-prof.cpp (PR #97245)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 30 18:04:52 PDT 2024


https://github.com/minglotus-6 created https://github.com/llvm/llvm-project/pull/97245

Fix https://lab.llvm.org/buildbot/#/builders/122/builds/150

The error is 

```
<stdin>:1:1: note: scanning from here
/home/tcwg-buildbot/worker/clang-armv8-lld-2stage/llvm/compiler-rt/test/profile/Linux/instrprof-vtable-value-prof.cpp:168:10: fatal error: 'cstdio' file not found
^
<stdin>:1:57: note: possible intended match here
/home/tcwg-buildbot/worker/clang-armv8-lld-2stage/llvm/compiler-rt/test/profile/Linux/instrprof-vtable-value-prof.cpp:168:10: fatal error: 'cstdio' file not found
                                                        ^
```

>From e96419483327fc84bc8d87e591029702a694e827 Mon Sep 17 00:00:00 2001
From: mingmingl <mingmingl at google.com>
Date: Sun, 30 Jun 2024 18:03:39 -0700
Subject: [PATCH] [compiler-rt][test]Simplify instrprof-vtable-value-prof.cpp

---
 .../test/profile/Linux/instrprof-vtable-value-prof.cpp    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/compiler-rt/test/profile/Linux/instrprof-vtable-value-prof.cpp b/compiler-rt/test/profile/Linux/instrprof-vtable-value-prof.cpp
index efb24751da5ff..5d3ec9557beff 100644
--- a/compiler-rt/test/profile/Linux/instrprof-vtable-value-prof.cpp
+++ b/compiler-rt/test/profile/Linux/instrprof-vtable-value-prof.cpp
@@ -165,8 +165,8 @@
 //
 // IR: [[MERGE0]]:
 // IR:    [[RES2:%.*]] = phi i32 [ [[RES1]], %[[MERGE1]] ], [ [[RESBB1]], %[[BB1]] ]
-#include <cstdio>
-#include <cstdlib>
+
+#include <stdlib.h>
 class Base {
 public:
   virtual int func(int a, int b) = 0;
@@ -195,8 +195,9 @@ __attribute__((noinline)) Base *createType(int a) {
     base = new Derived2();
   return base;
 }
+
+static volatile int sum = 0;
 int main(int argc, char **argv) {
-  int sum = 0;
   for (int i = 0; i < 1000; i++) {
     int a = rand();
     int b = rand();
@@ -206,6 +207,5 @@ int main(int argc, char **argv) {
 
     delete ptr;
   }
-  printf("sum is %d\n", sum);
   return 0;
 }



More information about the llvm-commits mailing list