1 : /*
2 : * Copyright 2008 The Native Client Authors. All rights reserved.
3 : * Use of this source code is governed by a BSD-style license that can
4 : * be found in the LICENSE file.
5 : */
6 :
7 : #include <stdio.h>
8 : #include <string.h>
9 :
10 : #include "native_client/src/include/portability.h"
11 : #include "native_client/src/include/nacl_assert.h"
12 :
13 :
14 1 : int main() {
15 : char buf[100];
16 :
17 1 : sprintf(buf, "%"NACL_PRIxS, (size_t) -1);
18 1 : printf("got:%s\n", buf);
19 : if (sizeof(size_t) == 4) {
20 1 : ASSERT_EQ(strcmp(buf, "ffffffff"), 0);
21 : } else if (sizeof(size_t) == 8) {
22 : ASSERT_EQ(strcmp(buf, "ffffffffffffffff"), 0);
23 : } else {
24 : ASSERT_MSG(0, "Unknown size_t size");
25 : }
26 1 : return 0;
27 : }
|