Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'bolt/test/Inputs/plt.c')
-rw-r--r--bolt/test/Inputs/plt.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/bolt/test/Inputs/plt.c b/bolt/test/Inputs/plt.c
new file mode 100644
index 000000000000..475c15b9cb3c
--- /dev/null
+++ b/bolt/test/Inputs/plt.c
@@ -0,0 +1,20 @@
+#include "stub.h"
+
+void *(*memcpy_p)(void *dest, const void *src, unsigned long n);
+void *(*memset_p)(void *dest, int c, unsigned long n);
+
+int main() {
+ int a = 0xdeadbeef, b = 0;
+
+ memcpy_p = memcpy;
+ memcpy_p(&b, &a, sizeof(b));
+ if (b != 0xdeadbeef)
+ return 1;
+
+ memset_p = memset;
+ memset_p(&a, 0, sizeof(a));
+ if (a != 0)
+ return 1;
+
+ printf("Test completed\n");
+}