about summary refs log tree commit diff homepage
path: root/test/Runtime/POSIX/FilePerm.c
blob: 818d482f9c66c093abff70c76836c6fe0a0ae09b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc
// RUN: %klee --posix-runtime --init-env %t.bc --sym-files 1 10 --sym-stdout 2>%t.log 
// RUN: test -f klee-last/test000001.bout
// RUN: test -f klee-last/test000002.bout
// RUN: test -f klee-last/test000003.bout

#include <stdio.h>       
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(int argc, char** argv) {
  int fd = open("A", O_RDWR);
  if (fd != -1)
    fprintf(stderr, "File 'A' opened successfully\n");
  else fprintf(stderr, "Cannot open file 'A'\n");

  if (fd != -1)
    close(fd);
}