From 4168efe1b2243ed31c30c82583a18bff78cfa076 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 8 Dec 2021 14:25:42 +0800 Subject: [PATCH] [NFC] Fix C++20 module test in PPC and warning --- clang/lib/Sema/SemaModule.cpp | 3 ++- clang/test/CodeGenCXX/module-extern-C.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp index 34a6c6e..f497199 100644 --- a/clang/lib/Sema/SemaModule.cpp +++ b/clang/lib/Sema/SemaModule.cpp @@ -712,7 +712,8 @@ Module *Sema::PushGlobalModuleFragment(SourceLocation BeginLoc, // Enter the scope of the global module. ModuleScopes.push_back({BeginLoc, GlobalModule, /*ModuleInterface=*/false, - /*ImplicitGlobalModuleFragment=*/IsImplicit}); + /*ImplicitGlobalModuleFragment=*/IsImplicit, + /*VisibleModuleSet*/{}}); VisibleModules.setVisible(GlobalModule, BeginLoc); return GlobalModule; diff --git a/clang/test/CodeGenCXX/module-extern-C.cpp b/clang/test/CodeGenCXX/module-extern-C.cpp index 0b4bbc2..d8012ad 100644 --- a/clang/test/CodeGenCXX/module-extern-C.cpp +++ b/clang/test/CodeGenCXX/module-extern-C.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++20 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s module; @@ -6,21 +6,21 @@ module; export module x; -// CHECK: define dso_local void @foo() +// CHECK: void @foo() extern "C" void foo() { return; } extern "C" { -// CHECK: define dso_local void @bar() +// CHECK: void @bar() void bar() { return; } -// CHECK: define dso_local i32 @baz() +// CHECK: i32 @baz() int baz() { return 3; } -// CHECK: define dso_local double @double_func() +// CHECK: double @double_func() double double_func() { return 5.0; } -- 2.7.4