summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py
blob: f34e67112527a3ebc857ef6431da9a586db97da7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python

# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
Test VCCLCompilerTool EnableEnhancedInstructionSet setting.
"""

from __future__ import print_function

import TestGyp

import os
import sys

if sys.platform == 'win32':
  print("This test is currently disabled: https://crbug.com/483696.")
  sys.exit(0)

  test = TestGyp.TestGyp()

  CHDIR = 'compiler-flags'
  test.run_gyp('enable-enhanced-instruction-set.gyp', chdir=CHDIR)

  test.build('enable-enhanced-instruction-set.gyp', test.ALL, chdir=CHDIR)

  test.run_built_executable('sse_extensions', chdir=CHDIR,
                            stdout='/arch:SSE\n')
  test.run_built_executable('sse2_extensions', chdir=CHDIR,
                            stdout='/arch:SSE2\n')

  # /arch:AVX introduced in VS2010, but MSBuild support lagged until 2012.
  if os.path.exists(test.built_file_path('avx_extensions')):
    test.run_built_executable('avx_extensions', chdir=CHDIR,
                              stdout='/arch:AVX\n')

  # /arch:IA32 introduced in VS2012.
  if os.path.exists(test.built_file_path('no_extensions')):
    test.run_built_executable('no_extensions', chdir=CHDIR,
                              stdout='/arch:IA32\n')

  # /arch:AVX2 introduced in VS2013r2.
  if os.path.exists(test.built_file_path('avx2_extensions')):
    test.run_built_executable('avx2_extensions', chdir=CHDIR,
                              stdout='/arch:AVX2\n')

  test.pass_test()