OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 Import('env') | 6 Import('env') |
7 | 7 |
8 def AddLibcTest(env, src, exit_status='0', golden_file=None, test_suffix='', | 8 def AddLibcTest(env, src, exit_status='0', golden_file=None, test_suffix='', |
9 is_broken=False, compile_env=None, link_env=None, | 9 is_broken=False, compile_env=None, link_env=None, |
10 EXTRA_LIBS=[]): | 10 EXTRA_LIBS=[]): |
(...skipping 27 matching lines...) Expand all Loading... |
38 is_broken=is_broken) | 38 is_broken=is_broken) |
39 | 39 |
40 AddLibcTest(env, 'memcpy_move_set.c', '0', | 40 AddLibcTest(env, 'memcpy_move_set.c', '0', |
41 golden_file=env.File('memcpy_move_set.stdout')) | 41 golden_file=env.File('memcpy_move_set.stdout')) |
42 AddLibcTest(env, 'malloc_realloc_calloc_free.c', '0') | 42 AddLibcTest(env, 'malloc_realloc_calloc_free.c', '0') |
43 | 43 |
44 AddLibcTest(env, 'strtoll.c', '0') | 44 AddLibcTest(env, 'strtoll.c', '0') |
45 AddLibcTest(env, 'strtoull.c', '0') | 45 AddLibcTest(env, 'strtoull.c', '0') |
46 AddLibcTest(env, 'wcstoll.c', '0', is_broken=env.Bit('nacl_glibc')) | 46 AddLibcTest(env, 'wcstoll.c', '0', is_broken=env.Bit('nacl_glibc')) |
47 AddLibcTest(env, 'iconv.c', '0', | 47 AddLibcTest(env, 'iconv.c', '0', |
48 is_broken=(env.Bit('nacl_glibc') or | 48 # TODO(jfb) Various breakage on newlib ARM and x86 toolchains as well |
49 (env.Bit('target_arm') and not env.Bit('bitcode')))) | 49 # as on glibc. |
| 50 is_broken=not env.Bit('bitcode')) |
50 | 51 |
51 # Test that using link-time optimization does not convert calls to | 52 # Test that using link-time optimization does not convert calls to |
52 # library functions that were never linked in. | 53 # library functions that were never linked in. |
53 if env.Bit('bitcode'): | 54 if env.Bit('bitcode'): |
54 unopt_env = env.Clone() | 55 unopt_env = env.Clone() |
55 unopt_env.Append(CFLAGS=['-O0']) | 56 unopt_env.Append(CFLAGS=['-O0']) |
56 unopt_env.Append(CCFLAGS=['-O0']) | 57 unopt_env.Append(CCFLAGS=['-O0']) |
57 opt_env = env.Clone() | 58 opt_env = env.Clone() |
58 opt_env.Append(CFLAGS=['-O3']) | 59 opt_env.Append(CFLAGS=['-O3']) |
59 opt_env.Append(CCFLAGS=['-O3']) | 60 opt_env.Append(CCFLAGS=['-O3']) |
60 opt_env.Append(LINKFLAGS=['-O3']) | 61 opt_env.Append(LINKFLAGS=['-O3']) |
61 AddLibcTest(env, 'printf_to_puts.c', '0', | 62 AddLibcTest(env, 'printf_to_puts.c', '0', |
62 compile_env=unopt_env, link_env=opt_env) | 63 compile_env=unopt_env, link_env=opt_env) |
63 | 64 |
64 if env.Bit('nacl_glibc'): | 65 if env.Bit('nacl_glibc'): |
65 memalign_env = env | 66 memalign_env = env |
66 else: | 67 else: |
67 memalign_env = env.Clone() | 68 memalign_env = env.Clone() |
68 memalign_env.Append(CPPDEFINES=['NEWLIB=1']) | 69 memalign_env.Append(CPPDEFINES=['NEWLIB=1']) |
69 AddLibcTest(memalign_env, 'posix_memalign.c') | 70 AddLibcTest(memalign_env, 'posix_memalign.c') |
OLD | NEW |