Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 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 # Tests for Native Client fixed-feature CPU mode. The fixed-feature CPU | 6 # Tests for Native Client fixed-feature CPU mode. The fixed-feature CPU |
| 7 # mode requires SSE and disallows MMX and x87. By fixing the instruction set | 7 # mode requires SSE and disallows MMX and x87. By fixing the instruction set |
| 8 # it allows exclusion of the CPUID instruction and use of a read-only text | 8 # it allows exclusion of the CPUID instruction and use of a read-only text |
| 9 # segment. See http://code.google.com/p/nativeclient/issues/detail?id=2684 | 9 # segment. See http://code.google.com/p/nativeclient/issues/detail?id=2684 |
| 10 Import('env') | 10 Import('env') |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 expect_null_Z_status=127 | 53 expect_null_Z_status=127 |
| 54 expect_sse_Z_status=127 | 54 expect_sse_Z_status=127 |
| 55 expect_x87_Z_status=127 | 55 expect_x87_Z_status=127 |
| 56 elif env.Bit('target_x86_64'): | 56 elif env.Bit('target_x86_64'): |
| 57 # 64-bit glibc: fails, runnable-ld.so requires RDTSC, x87 | 57 # 64-bit glibc: fails, runnable-ld.so requires RDTSC, x87 |
| 58 expect_null_Z_status=1 | 58 expect_null_Z_status=1 |
| 59 expect_sse_Z_status=1 | 59 expect_sse_Z_status=1 |
| 60 expect_x87_Z_status=1 | 60 expect_x87_Z_status=1 |
| 61 else: | 61 else: |
| 62 if env.Bit('target_x86_32'): | 62 if env.Bit('target_x86_32'): |
| 63 # 32-bit newlib: passes | 63 # 32-bit newlib: passes, except nacl-clang's ff_null_z for reasons which |
| 64 expect_null_Z_status=0 | 64 # are unknown because ncval is broken and ncval_new doesn't support |
|
Nick Bray (chromium)
2014/10/10 19:53:25
https://groups.google.com/forum/#!msg/native-clien
Derek Schuff
2014/10/10 20:56:24
OK. but it doesn't help me in finding out the reas
| |
| 65 # FF mode. | |
| 66 if env.Bit('nacl_clang'): | |
| 67 expect_null_Z_status=1 | |
| 68 else: | |
| 69 expect_null_Z_status=0 | |
| 65 expect_sse_Z_status=1 | 70 expect_sse_Z_status=1 |
| 66 expect_x87_Z_status=1 | 71 expect_x87_Z_status=1 |
| 67 elif env.Bit('target_x86_64'): | 72 elif env.Bit('target_x86_64'): |
| 68 # R-DFA ignores LM bit and assumes it's always enabled | 73 # R-DFA ignores LM bit and assumes it's always enabled |
| 69 expect_null_Z_status=0 | 74 expect_null_Z_status=0 |
| 70 expect_sse_Z_status=0 | 75 expect_sse_Z_status=0 |
| 71 expect_x87_Z_status=1 | 76 expect_x87_Z_status=1 |
| 72 | 77 |
| 73 test_suites = ['small_tests', 'sel_ldr_tests', 'validator_tests'] | 78 test_suites = ['small_tests', 'sel_ldr_tests', 'validator_tests'] |
| 74 ff_null_nexe = env.ComponentProgram('ff_null', 'ff_null.c', | 79 ff_null_nexe = env.ComponentProgram('ff_null', 'ff_null.c', |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 105 'ff_hello_world_sse_Z.out', ff_hello_world_sse_nexe, | 110 'ff_hello_world_sse_Z.out', ff_hello_world_sse_nexe, |
| 106 exit_status=expect_sse_Z_status, | 111 exit_status=expect_sse_Z_status, |
| 107 sel_ldr_flags=['-Z']) | 112 sel_ldr_flags=['-Z']) |
| 108 env.AddNodeToTestSuite(node, test_suites, 'run_ff_sse_Z_test', | 113 env.AddNodeToTestSuite(node, test_suites, 'run_ff_sse_Z_test', |
| 109 is_broken=is_validation_broken) | 114 is_broken=is_validation_broken) |
| 110 | 115 |
| 111 # NOTE: -mfpmath=387 does not work for x86-64. See: | 116 # NOTE: -mfpmath=387 does not work for x86-64. See: |
| 112 # http://code.google.com/p/nativeclient/issues/detail?id=2692 | 117 # http://code.google.com/p/nativeclient/issues/detail?id=2692 |
| 113 if not env.Bit('target_x86_64') and not env.Bit('bitcode'): | 118 if not env.Bit('target_x86_64') and not env.Bit('bitcode'): |
| 114 x87_env = env.Clone() | 119 x87_env = env.Clone() |
| 115 x87_env.Append(CCFLAGS=['-mfpmath=387']) | 120 x87_env.Append(CCFLAGS=['-mfpmath=387', '-mno-sse']) |
| 116 x87_o = x87_env.ComponentObject('ff_hello_world_x87.o', 'ff_hello_world.c') | 121 x87_o = x87_env.ComponentObject('ff_hello_world_x87.o', 'ff_hello_world.c') |
| 117 ff_hello_world_x87_nexe = x87_env.ComponentProgram( | 122 ff_hello_world_x87_nexe = x87_env.ComponentProgram( |
| 118 'ff_hello_world_x87', | 123 'ff_hello_world_x87', |
| 119 'ff_hello_world_x87.o', | 124 'ff_hello_world_x87.o', |
| 120 EXTRA_LIBS=['${NONIRT_LIBS}']) | 125 EXTRA_LIBS=['${NONIRT_LIBS}']) |
| 121 | 126 |
| 122 # ff_hello_world_x87 should pass in default mode | 127 # ff_hello_world_x87 should pass in default mode |
| 123 node = env.CommandSelLdrTestNacl( | 128 node = env.CommandSelLdrTestNacl( |
| 124 'ff_hello_world_x87.out', ff_hello_world_x87_nexe, | 129 'ff_hello_world_x87.out', ff_hello_world_x87_nexe, |
| 125 stdout_golden=env.File('ff_hello_world.stdout')) | 130 stdout_golden=env.File('ff_hello_world.stdout')) |
| 126 env.AddNodeToTestSuite(node, test_suites, 'run_ff_x87_test') | 131 env.AddNodeToTestSuite(node, test_suites, 'run_ff_x87_test') |
| 127 | 132 |
| 128 # ff_hello_world_x87 should fail in fixed function CPU mode | 133 # ff_hello_world_x87 should fail in fixed function CPU mode |
| 129 node = env.CommandSelLdrTestNacl( | 134 node = env.CommandSelLdrTestNacl( |
| 130 'ff_hello_world_x87_Z.out', ff_hello_world_x87_nexe, | 135 'ff_hello_world_x87_Z.out', ff_hello_world_x87_nexe, |
| 131 exit_status=expect_x87_Z_status, | 136 exit_status=expect_x87_Z_status, |
| 132 sel_ldr_flags=['-Z']) | 137 sel_ldr_flags=['-Z']) |
| 133 env.AddNodeToTestSuite(node, test_suites, 'run_ff_x87_Z_test', | 138 env.AddNodeToTestSuite(node, test_suites, 'run_ff_x87_Z_test', |
| 134 is_broken=is_validation_broken) | 139 is_broken=is_validation_broken) |
| OLD | NEW |