Skip to content

Commit fbd8b97

Browse files
committed
Un-XFAIL validation-test/Runtime/class_stubs.m and adjust for Clang changes
The objc_loadClassref() symbol is weak linked from Clang now, so we can un-XFAIL this test. Note that we have to pass a special flag to Clang since objc_loadClassref() is not in the SDK's TBD files yet. Also, change the test to use its own asserts instead of FileCheck since there's no output unless a new libobjc is available.
1 parent b3d6214 commit fbd8b97

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

validation-test/Runtime/class_stubs.m

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
// RUN: %target-build-swift -emit-library -emit-module -o %t/libfirst.dylib -emit-objc-header-path %t/first.h %S/Inputs/class-stubs-from-objc/first.swift -Xlinker -install_name -Xlinker @executable_path/libfirst.dylib -enable-library-evolution
66
// RUN: %target-build-swift -emit-library -o %t/libsecond.dylib -emit-objc-header-path %t/second.h -I %t %S/Inputs/class-stubs-from-objc/second.swift -Xlinker -install_name -Xlinker @executable_path/libsecond.dylib -lfirst -L %t -Xfrontend -enable-resilient-objc-class-stubs
77
// RUN: cp %S/Inputs/class-stubs-from-objc/module.map %t/
8-
// RUN: xcrun %clang %s -I %t -L %t -fmodules -fobjc-arc -o %t/main -lfirst -lsecond
8+
// RUN: xcrun %clang %s -I %t -L %t -fmodules -fobjc-arc -o %t/main -lfirst -lsecond -Wl,-U,_objc_loadClassref
99
// RUN: %target-codesign %t/main %t/libfirst.dylib %t/libsecond.dylib
10-
// RUN: %target-run %t/main %t/libfirst.dylib %t/libsecond.dylib | %FileCheck %s
10+
// RUN: %target-run %t/main %t/libfirst.dylib %t/libsecond.dylib
1111

1212
// REQUIRES: executable_test
1313
// REQUIRES: objc_interop
1414

15-
// XFAIL: *
16-
1715
#import <dlfcn.h>
1816
#import <stdio.h>
1917
#import "second.h"
@@ -39,9 +37,17 @@ int main(int argc, const char * const argv[]) {
3937

4038
DerivedClass *obj = [[DerivedClass alloc] init];
4139

42-
// CHECK: Result is 43
43-
printf("Result is %ld\n", [obj instanceMethod]);
40+
{
41+
long result = [obj instanceMethod];
42+
printf("[obj instanceMethod] == %ld\n", result);
43+
if (result != 43)
44+
exit(EXIT_FAILURE);
45+
}
4446

45-
// CHECK: Result is 31338
46-
printf("Result is %ld\n", [DerivedClass classMethod]);
47+
{
48+
long result = [DerivedClass classMethod];
49+
printf("[obj classMethod] == %ld\n", result);
50+
if (result != 31338)
51+
exit(EXIT_FAILURE);
52+
}
4753
}

0 commit comments

Comments
 (0)