Index: cfe/trunk/lib/Basic/Targets.cpp =================================================================== --- cfe/trunk/lib/Basic/Targets.cpp +++ cfe/trunk/lib/Basic/Targets.cpp @@ -6994,6 +6994,7 @@ LargeArrayMinWidth = 128; LargeArrayAlign = 128; SimdDefaultAlign = 128; + SigAtomicType = SignedLong; } protected: @@ -7096,8 +7097,7 @@ public: explicit WebAssembly32TargetInfo(const llvm::Triple &T) : WebAssemblyTargetInfo(T) { - // TODO: Set this to the correct value once the spec issues are resolved. - MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 0; + MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; DataLayoutString = "e-p:32:32-i64:64-n32:64-S128"; } @@ -7115,8 +7115,7 @@ : WebAssemblyTargetInfo(T) { LongAlign = LongWidth = 64; PointerAlign = PointerWidth = 64; - // TODO: Set this to the correct value once the spec issues are resolved. - MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 0; + MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; DataLayoutString = "e-p:64:64-i64:64-n32:64-S128"; } Index: cfe/trunk/test/Preprocessor/init.c =================================================================== --- cfe/trunk/test/Preprocessor/init.c +++ cfe/trunk/test/Preprocessor/init.c @@ -8472,17 +8472,17 @@ // WEBASSEMBLY32-NEXT:#define __FLT_MIN_EXP__ (-125){{$}} // WEBASSEMBLY32-NEXT:#define __FLT_MIN__ 1.17549435e-38F{{$}} // WEBASSEMBLY32-NEXT:#define __FLT_RADIX__ 2{{$}} -// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_BOOL_LOCK_FREE 1{{$}} -// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 1{{$}} -// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 1{{$}} -// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_CHAR_LOCK_FREE 1{{$}} -// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_INT_LOCK_FREE 1{{$}} +// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_BOOL_LOCK_FREE 2{{$}} +// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2{{$}} +// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2{{$}} +// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_CHAR_LOCK_FREE 2{{$}} +// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_INT_LOCK_FREE 2{{$}} // WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_LLONG_LOCK_FREE 1{{$}} -// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_LONG_LOCK_FREE 1{{$}} -// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_POINTER_LOCK_FREE 1{{$}} -// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_SHORT_LOCK_FREE 1{{$}} +// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_LONG_LOCK_FREE 2{{$}} +// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_POINTER_LOCK_FREE 2{{$}} +// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_SHORT_LOCK_FREE 2{{$}} // WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1{{$}} -// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 1{{$}} +// WEBASSEMBLY32-NEXT:#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2{{$}} // WEBASSEMBLY32-NEXT:#define __GNUC_MINOR__ {{.}} // WEBASSEMBLY32-NEXT:#define __GNUC_PATCHLEVEL__ {{.}} // WEBASSEMBLY32-NEXT:#define __GNUC_STDC_INLINE__ 1{{$}} @@ -8586,7 +8586,7 @@ // WEBASSEMBLY32-NOT:#define __REGISTER_PREFIX__ // WEBASSEMBLY32-NEXT:#define __SCHAR_MAX__ 127{{$}} // WEBASSEMBLY32-NEXT:#define __SHRT_MAX__ 32767{{$}} -// WEBASSEMBLY32-NEXT:#define __SIG_ATOMIC_MAX__ 2147483647{{$}} +// WEBASSEMBLY32-NEXT:#define __SIG_ATOMIC_MAX__ 2147483647L{{$}} // WEBASSEMBLY32-NEXT:#define __SIG_ATOMIC_WIDTH__ 32{{$}} // WEBASSEMBLY32-NEXT:#define __SIZEOF_DOUBLE__ 8{{$}} // WEBASSEMBLY32-NEXT:#define __SIZEOF_FLOAT__ 4{{$}} @@ -8788,17 +8788,17 @@ // WEBASSEMBLY64-NEXT:#define __FLT_MIN_EXP__ (-125){{$}} // WEBASSEMBLY64-NEXT:#define __FLT_MIN__ 1.17549435e-38F{{$}} // WEBASSEMBLY64-NEXT:#define __FLT_RADIX__ 2{{$}} -// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_BOOL_LOCK_FREE 1{{$}} -// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 1{{$}} -// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 1{{$}} -// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_CHAR_LOCK_FREE 1{{$}} -// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_INT_LOCK_FREE 1{{$}} -// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_LLONG_LOCK_FREE 1{{$}} -// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_LONG_LOCK_FREE 1{{$}} -// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_POINTER_LOCK_FREE 1{{$}} -// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_SHORT_LOCK_FREE 1{{$}} +// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_BOOL_LOCK_FREE 2{{$}} +// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2{{$}} +// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2{{$}} +// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_CHAR_LOCK_FREE 2{{$}} +// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_INT_LOCK_FREE 2{{$}} +// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_LLONG_LOCK_FREE 2{{$}} +// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_LONG_LOCK_FREE 2{{$}} +// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_POINTER_LOCK_FREE 2{{$}} +// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_SHORT_LOCK_FREE 2{{$}} // WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1{{$}} -// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 1{{$}} +// WEBASSEMBLY64-NEXT:#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2{{$}} // WEBASSEMBLY64-NEXT:#define __GNUC_MINOR__ {{.}} // WEBASSEMBLY64-NEXT:#define __GNUC_PATCHLEVEL__ {{.}} // WEBASSEMBLY64-NEXT:#define __GNUC_STDC_INLINE__ 1{{$}} @@ -8902,8 +8902,8 @@ // WEBASSEMBLY64-NOT:#define __REGISTER_PREFIX__ // WEBASSEMBLY64-NEXT:#define __SCHAR_MAX__ 127{{$}} // WEBASSEMBLY64-NEXT:#define __SHRT_MAX__ 32767{{$}} -// WEBASSEMBLY64-NEXT:#define __SIG_ATOMIC_MAX__ 2147483647{{$}} -// WEBASSEMBLY64-NEXT:#define __SIG_ATOMIC_WIDTH__ 32{{$}} +// WEBASSEMBLY64-NEXT:#define __SIG_ATOMIC_MAX__ 9223372036854775807L{{$}} +// WEBASSEMBLY64-NEXT:#define __SIG_ATOMIC_WIDTH__ 64{{$}} // WEBASSEMBLY64-NEXT:#define __SIZEOF_DOUBLE__ 8{{$}} // WEBASSEMBLY64-NEXT:#define __SIZEOF_FLOAT__ 4{{$}} // WEBASSEMBLY64-NEXT:#define __SIZEOF_INT128__ 16{{$}}