Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / Posix / sem_open.cpp
blob9c03d5abb3cdbdc8f1baa9a4c4cbe02cb6b21ed8
1 // RUN: %clangxx -O0 %s -o %t && %run %t
3 // Android does not implement these calls.
4 // UNSUPPORTED: android
6 #include <assert.h>
7 #include <fcntl.h>
8 #include <semaphore.h>
9 #include <stdio.h>
10 #include <unistd.h>
12 int main() {
13 char name[1024];
14 sprintf(name, "/sem_open_test_%zu", (size_t)getpid());
16 sem_t *s = sem_open(name, O_CREAT, 0644, 123);
17 assert(s != SEM_FAILED);
18 assert(sem_close(s) == 0);
19 assert(sem_unlink(name) == 0);