From ecbcefd693dd62f9242618b3cf838565e829cc7f Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Sun, 30 Jan 2022 11:10:59 -0800 Subject: [PATCH] [clang][WebAssemmbly] Call TargetInfo::adjust in derived method. The superclass method handles a bunch of useful things. For example it applies flags such as `-fnew-alignment` which doesn't work without this patch. Differential Revision: https://reviews.llvm.org/D118573 --- clang/lib/Basic/Targets/WebAssembly.cpp | 1 + clang/test/CXX/cpp/cpp.predefined/p1.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/clang/lib/Basic/Targets/WebAssembly.cpp b/clang/lib/Basic/Targets/WebAssembly.cpp index 2309997eb77b..023c03c7cf5c 100644 --- a/clang/lib/Basic/Targets/WebAssembly.cpp +++ b/clang/lib/Basic/Targets/WebAssembly.cpp @@ -255,6 +255,7 @@ ArrayRef WebAssemblyTargetInfo::getTargetBuiltins() const { void WebAssemblyTargetInfo::adjust(DiagnosticsEngine &Diags, LangOptions &Opts) { + TargetInfo::adjust(Diags, Opts); // If the Atomics feature isn't available, turn off POSIXThreads and // ThreadModel, so that we don't predefine _REENTRANT or __STDCPP_THREADS__. if (!HasAtomics) { diff --git a/clang/test/CXX/cpp/cpp.predefined/p1.cpp b/clang/test/CXX/cpp/cpp.predefined/p1.cpp index c0dcbd54f387..42a80d37c43d 100644 --- a/clang/test/CXX/cpp/cpp.predefined/p1.cpp +++ b/clang/test/CXX/cpp/cpp.predefined/p1.cpp @@ -1,6 +1,7 @@ // RUN: %clang_cc1 -std=c++1z %s -verify -triple x86_64-linux-gnu -DALIGN=16 // RUN: %clang_cc1 -std=c++1z %s -verify -fnew-alignment=2 -DALIGN=2 // RUN: %clang_cc1 -std=c++1z %s -verify -fnew-alignment=256 -DALIGN=256 +// RUN: %clang_cc1 -std=c++1z %s -verify -triple wasm32-unknown-unknown -fnew-alignment=256 -DALIGN=256 // expected-no-diagnostics