[clang-repl][NFC] Split weak symbol test to a new test
authorJun Zhang <jun@junz.org>
Thu, 7 Jul 2022 14:14:04 +0000 (22:14 +0800)
committerJun Zhang <jun@junz.org>
Fri, 8 Jul 2022 01:17:11 +0000 (09:17 +0800)
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 <jun@junz.org>
Differential Revision: https://reviews.llvm.org/D129250

clang/test/Interpreter/execute-weak.cpp [new file with mode: 0644]
clang/test/Interpreter/execute.cpp

diff --git a/clang/test/Interpreter/execute-weak.cpp b/clang/test/Interpreter/execute-weak.cpp
new file mode 100644 (file)
index 0000000..e4577e3
--- /dev/null
@@ -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
index b5dad47..f5c70c2 100644 (file)
@@ -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<unsigned long long
 inline int foo() { return 42; }
 int r3 = foo();
 
-int __attribute__((weak)) bar() { return 1; }
-auto r4 = printf("bar() = %d\n", bar());
-// CHECK-NEXT: bar() = 1
-
 %quit