about summary refs log tree commit diff homepage
path: root/test/Feature/ByteSwap.c
blob: f85ac3b1d4489e758a468346cc5e6bb1a64bcc28 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t1.bc
// RUN: %klee --libc=klee --exit-on-error %t1.bc

#include <arpa/inet.h>
#include <assert.h>

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