]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorno author <no_author@no_author>
Tue, 16 Nov 2004 19:40:05 +0000 (19:40 +0000)
committerno author <no_author@no_author>
Tue, 16 Nov 2004 19:40:05 +0000 (19:40 +0000)
'VALGRIND_2_2_0_BRANCH'.

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_2_2_0_BRANCH@3031

none/tests/pth_stackalign.c [new file with mode: 0644]
none/tests/pth_stackalign.stderr.exp [new file with mode: 0644]
none/tests/pth_stackalign.stdout.exp [new file with mode: 0644]
none/tests/pth_stackalign.vgtest [new file with mode: 0644]

diff --git a/none/tests/pth_stackalign.c b/none/tests/pth_stackalign.c
new file mode 100644 (file)
index 0000000..df8e561
--- /dev/null
@@ -0,0 +1,34 @@
+#include <inttypes.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void *thread_main(void *arg)
+{
+  uintptr_t address = (uintptr_t)&arg;
+
+  printf("alignment = %" PRIuPTR "\n", address & 3U);
+
+  return NULL;
+}
+
+int main(int argc, char **argv)
+{
+  pthread_t t;
+  int e;
+
+  if ((e = pthread_create(&t, NULL, thread_main, NULL)) != 0)
+    {
+      fprintf(stderr, "pthread_create: %s\n", strerror(e));
+      exit(1);
+    }
+  
+  if ((e = pthread_join(t, NULL)) != 0)
+    {
+      fprintf(stderr, "pthread_join: %s\n", strerror(e));
+      exit(1);
+    }
+
+  exit(0);
+}
diff --git a/none/tests/pth_stackalign.stderr.exp b/none/tests/pth_stackalign.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/pth_stackalign.stdout.exp b/none/tests/pth_stackalign.stdout.exp
new file mode 100644 (file)
index 0000000..86e86d1
--- /dev/null
@@ -0,0 +1 @@
+alignment = 0
diff --git a/none/tests/pth_stackalign.vgtest b/none/tests/pth_stackalign.vgtest
new file mode 100644 (file)
index 0000000..f28ac1b
--- /dev/null
@@ -0,0 +1 @@
+prog: pth_stackalign