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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 expect_null_Z_status=127 | 55 expect_null_Z_status=127 |
| 56 expect_sse_Z_status=127 | 56 expect_sse_Z_status=127 |
| 57 expect_x87_Z_status=127 | 57 expect_x87_Z_status=127 |
| 58 elif env.Bit('target_x86_64'): | 58 elif env.Bit('target_x86_64'): |
| 59 # 64-bit glibc: fails, runnable-ld.so requires RDTSC, x87 | 59 # 64-bit glibc: fails, runnable-ld.so requires RDTSC, x87 |
| 60 expect_null_Z_status=1 | 60 expect_null_Z_status=1 |
| 61 expect_sse_Z_status=1 | 61 expect_sse_Z_status=1 |
| 62 expect_x87_Z_status=1 | 62 expect_x87_Z_status=1 |
| 63 else: | 63 else: |
| 64 if env.Bit('target_x86_32'): | 64 if env.Bit('target_x86_32'): |
| 65 # 32-bit newlib: passes | 65 # 32-bit newlib: passes, except nacl-clang's ff_null_z for reasons which |
| 66 expect_null_Z_status=0 | 66 # are uknown because ncval is broken and ncval_new doesn't support |
|
jvoung (off chromium)
2014/10/09 19:05:01
uknown -> unknown
Derek Schuff
2014/10/09 22:22:00
Done.
| |
| 67 # FF mode. | |
| 68 if env.Bit('nacl_clang'): | |
| 69 expect_null_Z_status=1 | |
| 70 else: | |
| 71 expect_null_Z_status=0 | |
| 67 expect_sse_Z_status=1 | 72 expect_sse_Z_status=1 |
| 68 expect_x87_Z_status=1 | 73 expect_x87_Z_status=1 |
| 69 elif env.Bit('target_x86_64'): | 74 elif env.Bit('target_x86_64'): |
| 70 if env.Bit('validator_ragel'): | 75 if env.Bit('validator_ragel'): |
| 71 # R-DFA ignores LM bit and assumes it's always enabled | 76 # R-DFA ignores LM bit and assumes it's always enabled |
| 72 expect_null_Z_status=0 | 77 expect_null_Z_status=0 |
| 73 expect_sse_Z_status=0 | 78 expect_sse_Z_status=0 |
| 74 else: | 79 else: |
| 75 # 64-bit newlib: requires LM(cltq), MMX(prefetchnta), CLFLUSH/FXSR(sfence) | 80 # 64-bit newlib: requires LM(cltq), MMX(prefetchnta), CLFLUSH/FXSR(sfence) |
| 76 # prefetchnta and sfence are classified incorrectly in the old validator | 81 # prefetchnta and sfence are classified incorrectly in the old validator |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 'ff_hello_world_sse_Z.out', ff_hello_world_sse_nexe, | 118 'ff_hello_world_sse_Z.out', ff_hello_world_sse_nexe, |
| 114 exit_status=expect_sse_Z_status, | 119 exit_status=expect_sse_Z_status, |
| 115 sel_ldr_flags=['-Z']) | 120 sel_ldr_flags=['-Z']) |
| 116 env.AddNodeToTestSuite(node, test_suites, 'run_ff_sse_Z_test', | 121 env.AddNodeToTestSuite(node, test_suites, 'run_ff_sse_Z_test', |
| 117 is_broken=is_validation_broken) | 122 is_broken=is_validation_broken) |
| 118 | 123 |
| 119 # NOTE: -mfpmath=387 does not work for x86-64. See: | 124 # NOTE: -mfpmath=387 does not work for x86-64. See: |
| 120 # http://code.google.com/p/nativeclient/issues/detail?id=2692 | 125 # http://code.google.com/p/nativeclient/issues/detail?id=2692 |
| 121 if not env.Bit('target_x86_64') and not env.Bit('bitcode'): | 126 if not env.Bit('target_x86_64') and not env.Bit('bitcode'): |
| 122 x87_env = env.Clone() | 127 x87_env = env.Clone() |
| 123 x87_env.Append(CCFLAGS=['-mfpmath=387']) | 128 x87_env.Append(CCFLAGS=['-mfpmath=387', '-mno-sse']) |
| 124 x87_o = x87_env.ComponentObject('ff_hello_world_x87.o', 'ff_hello_world.c') | 129 x87_o = x87_env.ComponentObject('ff_hello_world_x87.o', 'ff_hello_world.c') |
| 125 ff_hello_world_x87_nexe = x87_env.ComponentProgram( | 130 ff_hello_world_x87_nexe = x87_env.ComponentProgram( |
| 126 'ff_hello_world_x87', | 131 'ff_hello_world_x87', |
| 127 'ff_hello_world_x87.o', | 132 'ff_hello_world_x87.o', |
| 128 EXTRA_LIBS=['${NONIRT_LIBS}']) | 133 EXTRA_LIBS=['${NONIRT_LIBS}']) |
| 129 | 134 |
| 130 # ff_hello_world_x87 should pass in default mode | 135 # ff_hello_world_x87 should pass in default mode |
| 131 node = env.CommandSelLdrTestNacl( | 136 node = env.CommandSelLdrTestNacl( |
| 132 'ff_hello_world_x87.out', ff_hello_world_x87_nexe, | 137 'ff_hello_world_x87.out', ff_hello_world_x87_nexe, |
| 133 stdout_golden=env.File('ff_hello_world.stdout')) | 138 stdout_golden=env.File('ff_hello_world.stdout')) |
| 134 env.AddNodeToTestSuite(node, test_suites, 'run_ff_x87_test') | 139 env.AddNodeToTestSuite(node, test_suites, 'run_ff_x87_test') |
| 135 | 140 |
| 136 # ff_hello_world_x87 should fail in fixed function CPU mode | 141 # ff_hello_world_x87 should fail in fixed function CPU mode |
| 137 node = env.CommandSelLdrTestNacl( | 142 node = env.CommandSelLdrTestNacl( |
| 138 'ff_hello_world_x87_Z.out', ff_hello_world_x87_nexe, | 143 'ff_hello_world_x87_Z.out', ff_hello_world_x87_nexe, |
| 139 exit_status=expect_x87_Z_status, | 144 exit_status=expect_x87_Z_status, |
| 140 sel_ldr_flags=['-Z']) | 145 sel_ldr_flags=['-Z']) |
| 141 env.AddNodeToTestSuite(node, test_suites, 'run_ff_x87_Z_test', | 146 env.AddNodeToTestSuite(node, test_suites, 'run_ff_x87_Z_test', |
| 142 is_broken=is_validation_broken) | 147 is_broken=is_validation_broken) |
| OLD | NEW |