From: Jun Zhang Date: Thu, 7 Jul 2022 14:14:04 +0000 (+0800) Subject: [clang-repl][NFC] Split weak symbol test to a new test X-Git-Tag: upstream/15.0.7~2344 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eee6a12227a608e4c9aa4d9428d3fe55071f2d64;p=platform%2Fupstream%2Fllvm.git [clang-repl][NFC] Split weak symbol test to a new test Windows has some issues when we try to use `__attribute__((weak))` in JIT, so we disabled that. But it's not worth to disable the whole test just for this single feature. This patch split that part from the original test so we can keep testing stuff that normally working in Windows. Signed-off-by: Jun Zhang Differential Revision: https://reviews.llvm.org/D129250 --- diff --git a/clang/test/Interpreter/execute-weak.cpp b/clang/test/Interpreter/execute-weak.cpp new file mode 100644 index 0000000..e4577e3 --- /dev/null +++ b/clang/test/Interpreter/execute-weak.cpp @@ -0,0 +1,14 @@ +// RUN: clang-repl "int x = 10;" "int y=7; err;" "int y = 10;" +// RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \ +// RUN: 'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s +// REQUIRES: host-supports-jit +// UNSUPPORTED: system-aix +// XFAIL: system-windows +// CHECK-DRIVER: i = 10 +// RUN: cat %s | clang-repl | FileCheck %s +extern "C" int printf(const char *, ...); +int __attribute__((weak)) bar() { return 42; } +auto r4 = printf("bar() = %d\n", bar()); +// CHECK: bar() = 42 + +%quit diff --git a/clang/test/Interpreter/execute.cpp b/clang/test/Interpreter/execute.cpp index b5dad47..f5c70c2 100644 --- a/clang/test/Interpreter/execute.cpp +++ b/clang/test/Interpreter/execute.cpp @@ -3,7 +3,6 @@ // RUN: 'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s // REQUIRES: host-supports-jit // UNSUPPORTED: system-aix -// XFAIL: system-windows // CHECK-DRIVER: i = 10 // RUN: cat %s | clang-repl | FileCheck %s extern "C" int printf(const char *, ...); @@ -19,8 +18,4 @@ auto r2 = printf("S[f=%f, m=0x%llx]\n", s.f, reinterpret_cast