[clang] d71831a - [NFC] [clang-repl] Fix test failures due to incosistent target settings

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 31 00:08:30 PST 2024


Author: Chuanqi Xu
Date: 2024-01-31T16:05:15+08:00
New Revision: d71831a2172e4cf7c3f3540c472ce2aeb14d4505

URL: https://github.com/llvm/llvm-project/commit/d71831a2172e4cf7c3f3540c472ce2aeb14d4505
DIFF: https://github.com/llvm/llvm-project/commit/d71831a2172e4cf7c3f3540c472ce2aeb14d4505.diff

LOG: [NFC] [clang-repl] Fix test failures due to incosistent target settings

See https://github.com/llvm/llvm-project/pull/79261 for details.

It shows that clang-repl uses a different target triple with clang so that it
may be problematic if the calng-repl reads the generated BMI from clang
in a different target triple.

While the underlying issue is not easy to fix, this patch tries to make
this test green to not bother developers.

Added: 
    

Modified: 
    clang/test/Interpreter/cxx20-modules.cppm

Removed: 
    


################################################################################
diff  --git a/clang/test/Interpreter/cxx20-modules.cppm b/clang/test/Interpreter/cxx20-modules.cppm
index 2c6eba5255191..cd2b04fdc547d 100644
--- a/clang/test/Interpreter/cxx20-modules.cppm
+++ b/clang/test/Interpreter/cxx20-modules.cppm
@@ -6,13 +6,13 @@
 // RUN: split-file %s %t
 //
 // RUN: %clang -std=c++20 %t/mod.cppm --precompile \
-// RUN:     -o %t/mod.pcm
-// RUN: %clang %t/mod.pcm -c -o %t/mod.o
-// RUN: %clang -shared %t/mod.o -o %t/libmod.so
+// RUN:     -o %t/mod.pcm --target=x86_64-linux-gnu
+// RUN: %clang %t/mod.pcm -c -o %t/mod.o --target=x86_64-linux-gnu
+// RUN: %clang -shared %t/mod.o -o %t/libmod.so --target=x86_64-linux-gnu
 //
 // RUN: cat %t/import.cpp | env LD_LIBRARY_PATH=%t:$LD_LIBRARY_PATH \
 // RUN:     clang-repl -Xcc=-std=c++20 -Xcc=-fmodule-file=M=%t/mod.pcm \
-// RUN:     | FileCheck %t/import.cpp
+// RUN:     -Xcc=--target=x86_64-linux-gnu | FileCheck %t/import.cpp
 
 //--- mod.cppm
 export module M;


        


More information about the cfe-commits mailing list