ppc64: Arguments to iselInt128Expr_to_32x4 should be initialized.
[valgrind.git] / memcheck / tests / solaris / scalar_tsol_clearance.c
blob7b7555925e938455a32ab333e625cbb74370b18f
1 /* Scalar test for new labelsys syscall subcodes TSOL_GETCLEARANCE
2 and TSOL_SETCLEARANCE available on Solaris 11. */
4 #include "scalar.h"
6 #include <sys/syscall.h>
7 #include <sys/tsol/tsyscall.h>
8 #include <tsol/label.h>
10 __attribute__((noinline))
11 static void sys_labelsys(void)
13 GO(SYS_labelsys, "(TSOL_GETCLEARANCE) 2s 1m");
14 SY(SYS_labelsys, x0 + TSOL_GETCLEARANCE, x0 + 1); FAIL;
17 __attribute__((noinline))
18 static void sys_labelsys2(void)
20 m_label_t *label = m_label_alloc(USER_CLEAR);
21 if (label == NULL) {
22 perror("m_label_alloc");
23 return;
26 GO(SYS_labelsys, "(TSOL_GETCLEARANCE) 1s 0m");
27 SY(SYS_labelsys, x0 + TSOL_GETCLEARANCE, label); SUCC;
29 m_label_free(label);
32 __attribute__((noinline))
33 static void sys_labelsys3(void)
35 GO(SYS_labelsys, "(TSOL_SETCLEARANCE) 2s 1m");
36 SY(SYS_labelsys, x0 + TSOL_SETCLEARANCE, x0 + 1); FAIL;
39 __attribute__((noinline))
40 static void sys_labelsys4(void)
42 m_label_t *label = m_label_alloc(USER_CLEAR);
43 if (label == NULL) {
44 perror("m_label_alloc");
45 return;
48 int ret = getclearance(label);
49 if (ret != 0) {
50 perror("getclearance");
51 m_label_free(label);
52 return;
55 GO(SYS_labelsys, "(TSOL_SETCLEARANCE) 1s 0m");
56 SY(SYS_labelsys, x0 + TSOL_SETCLEARANCE, label); SUCC;
58 m_label_free(label);
61 int main(void)
63 /* Uninitialised, but we know px[0] is 0x0. */
64 long *px = malloc(sizeof(long));
65 x0 = px[0];
67 /* SYS_labelsys 52 */
68 sys_labelsys();
69 sys_labelsys2();
70 sys_labelsys3();
71 sys_labelsys4();
73 return 0;