mgorny created this revision.
The bump of default _MSC_VER which occurred in r315107 has caused
the '__declspec(thread)' TLSKind to change from STATIC to DYNAMIC.
Update the clang python binding tests accordingly. Test both for
behavior with old and new -fms-compatibility-version.
Repository:
rL LLVM
https://reviews.llvm.org/D39804
Files:
bindings/python/tests/cindex/test_tls_kind.py
Index: bindings/python/tests/cindex/test_tls_kind.py
===================================================================
--- bindings/python/tests/cindex/test_tls_kind.py
+++ bindings/python/tests/cindex/test_tls_kind.py
@@ -27,11 +27,19 @@
# The following case tests '__declspec(thread)'. Since it is a Microsoft
# specific extension, specific flags are required for the parser to pick
# these up.
- flags = ['-fms-extensions', '-target', 'x86_64-unknown-windows-win32']
+ flags = ['-fms-compatibility-version=18.00', '-fms-extensions',
+ '-target', 'x86_64-unknown-windows-win32']
tu = get_tu("""
__declspec(thread) int tls_declspec;
""", lang = 'cpp', flags=flags)
tls_declspec = get_cursor(tu.cursor, 'tls_declspec')
assert tls_declspec.tls_kind == TLSKind.STATIC
+ flags = ['-fms-extensions', '-target', 'x86_64-unknown-windows-win32']
+ tu = get_tu("""
+__declspec(thread) int tls_declspec;
+""", lang = 'cpp', flags=flags)
+
+ tls_declspec = get_cursor(tu.cursor, 'tls_declspec')
+ assert tls_declspec.tls_kind == TLSKind.DYNAMIC
Index: bindings/python/tests/cindex/test_tls_kind.py
===================================================================
--- bindings/python/tests/cindex/test_tls_kind.py
+++ bindings/python/tests/cindex/test_tls_kind.py
@@ -27,11 +27,19 @@
# The following case tests '__declspec(thread)'. Since it is a Microsoft
# specific extension, specific flags are required for the parser to pick
# these up.
- flags = ['-fms-extensions', '-target', 'x86_64-unknown-windows-win32']
+ flags = ['-fms-compatibility-version=18.00', '-fms-extensions',
+ '-target', 'x86_64-unknown-windows-win32']
tu = get_tu("""
__declspec(thread) int tls_declspec;
""", lang = 'cpp', flags=flags)
tls_declspec = get_cursor(tu.cursor, 'tls_declspec')
assert tls_declspec.tls_kind == TLSKind.STATIC
+ flags = ['-fms-extensions', '-target', 'x86_64-unknown-windows-win32']
+ tu = get_tu("""
+__declspec(thread) int tls_declspec;
+""", lang = 'cpp', flags=flags)
+
+ tls_declspec = get_cursor(tu.cursor, 'tls_declspec')
+ assert tls_declspec.tls_kind == TLSKind.DYNAMIC
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits