| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright 2011 The Native Client Authors. All rights reserved. | 2 # Copyright 2011 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can | 3 # Use of this source code is governed by a BSD-style license that can |
| 4 # be found in the LICENSE file. | 4 # be found in the LICENSE file. |
| 5 | 5 |
| 6 Import('env') | 6 Import('env') |
| 7 | 7 |
| 8 if not env.AllowNonStableBitcode(): | 8 if env['TOOLCHAIN_FEATURE_VERSION'] < 4: |
| 9 Return() | 9 # In old versions of the PNaCl toolchain, computed gotos are left as |
| 10 if env.Bit('bitcode'): | 10 # "indirectbr" and "blockaddress", which are not allowed by PNaCl's |
| 11 # Computed gotos are currently not allowed by PNaCl's bitcode ABI. | 11 # stable ABI. |
| 12 env.Append(LINKFLAGS=['--pnacl-disable-abi-check']) | 12 if not env.AllowNonStableBitcode(): |
| 13 Return() |
| 14 if env.Bit('bitcode'): |
| 15 env.Append(LINKFLAGS=['--pnacl-disable-abi-check']) |
| 13 | 16 |
| 14 # We are testing a GNU C extension which is disallowed by "-pedantic" mode. | 17 # We are testing a GNU C extension which is disallowed by "-pedantic" mode. |
| 15 env.FilterOut(CCFLAGS=['-pedantic']) | 18 env.FilterOut(CCFLAGS=['-pedantic']) |
| 16 | 19 |
| 17 prog = env.ComponentProgram('computed_goto', 'computed_goto.c', | 20 prog = env.ComponentProgram('computed_goto', 'computed_goto.c', |
| 18 EXTRA_LIBS=['${NONIRT_LIBS}']) | 21 EXTRA_LIBS=['${NONIRT_LIBS}']) |
| 19 node = env.CommandSelLdrTestNacl('computed_goto_test.out', prog) | 22 node = env.CommandSelLdrTestNacl('computed_goto_test.out', prog) |
| 20 env.AddNodeToTestSuite(node, ['small_tests'], 'run_computed_goto_test') | 23 env.AddNodeToTestSuite(node, ['small_tests'], 'run_computed_goto_test') |
| OLD | NEW |