about summary refs log tree commit diff homepage
path: root/test/Feature/ByteSwap.c
blob: d862b53d502639fc777fb197154a0d42a05c55c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %clang %s -emit-llvm %O0opt -c -o %t1.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --output-dir=%t.klee-out --libc=klee --exit-on-error %t1.bc
#include "klee/klee.h"
#include <arpa/inet.h>
#include <assert.h>

int main() {
  
  uint32_t n = 0;
  klee_make_symbolic(&n, sizeof(n), "n");
  
  uint32_t h = ntohl(n);
  assert(htonl(h) == n);
  
  return 0;
}