Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / Linux / shmctl.cpp
blobe1752bc894c063f3b998d81b90557fd5bd5ba4ed
1 // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
2 // XFAIL: android
3 //
4 // RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1
5 // Regression test for
6 // https://code.google.com/p/address-sanitizer/issues/detail?id=250
7 #include <stdio.h>
8 #include <sys/ipc.h>
9 #include <sys/shm.h>
10 #include <assert.h>
12 int main() {
13 int id = shmget(IPC_PRIVATE, 4096, 0644 | IPC_CREAT);
14 assert(id > -1);
15 struct shmid_ds ds;
16 int res = shmctl(id, IPC_STAT, &ds);
17 assert(res > -1);
18 printf("shm_segsz: %zd\n", ds.shm_segsz);
19 assert(ds.shm_segsz == 4096);
20 assert(-1 != shmctl(id, IPC_RMID, 0));
22 struct shm_info shmInfo;
23 res = shmctl(0, SHM_INFO, (struct shmid_ds *)&shmInfo);
24 assert(res > -1);
26 return 0;