JamesNagurne created this revision.
JamesNagurne added reviewers: plotfi, snidertm.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

In D63978 <https://reviews.llvm.org/D63978>, tests were added which expect that 
the default visibility is
maintained without an explicit option.

In at least one case, a downstream toolchain had the default
visibility set to 'hidden', which causes these tests to fail.

To avoid such assumptions, we can explicitly pass
-fvisibility=default to the tests that make this assumption.


Repository:
  rC Clang

https://reviews.llvm.org/D68897

Files:
  clang/test/InterfaceStubs/externstatic.c
  clang/test/InterfaceStubs/merge-conflict-test.c
  clang/test/InterfaceStubs/object-float.c
  clang/test/InterfaceStubs/object.c


Index: clang/test/InterfaceStubs/object.c
===================================================================
--- clang/test/InterfaceStubs/object.c
+++ clang/test/InterfaceStubs/object.c
@@ -1,6 +1,6 @@
-// RUN: %clang -c -o - -emit-interface-stubs %s | FileCheck 
-check-prefix=CHECK-TAPI %s
-// RUN: %clang -c -o - -emit-interface-stubs %s | FileCheck 
-check-prefix=CHECK-SYMBOLS %s
-// RUN: %clang -c -o - %s | llvm-nm - 2>&1 | FileCheck 
-check-prefix=CHECK-SYMBOLS %s
+// RUN: %clang -fvisibility=default -c -o - -emit-interface-stubs %s | 
FileCheck -check-prefix=CHECK-TAPI %s
+// RUN: %clang -fvisibility=default -c -o - -emit-interface-stubs %s | 
FileCheck -check-prefix=CHECK-SYMBOLS %s
+// RUN: %clang -fvisibility=default -c -o - %s | llvm-nm - 2>&1 | FileCheck 
-check-prefix=CHECK-SYMBOLS %s
 
 // CHECK-TAPI: data: { Type: Object, Size: 4 }
 // CHECK-SYMBOLS: data
Index: clang/test/InterfaceStubs/object-float.c
===================================================================
--- clang/test/InterfaceStubs/object-float.c
+++ clang/test/InterfaceStubs/object-float.c
@@ -1,3 +1,3 @@
-// RUN: not %clang -o - -emit-interface-stubs %s %S/object.c 2>&1 | FileCheck 
%s
+// RUN: not %clang -fvisibility=default -o - -emit-interface-stubs %s 
%S/object.c 2>&1 | FileCheck %s
 // CHECK: error: Interface Stub: Size Mismatch
-double data = 42.0;
\ No newline at end of file
+double data = 42.0;
Index: clang/test/InterfaceStubs/merge-conflict-test.c
===================================================================
--- clang/test/InterfaceStubs/merge-conflict-test.c
+++ clang/test/InterfaceStubs/merge-conflict-test.c
@@ -1,3 +1,3 @@
-// RUN: not %clang -o libfoo.so -emit-interface-stubs %s %S/driver-test.c 2>&1 
| FileCheck %s
+// RUN: not %clang -fvisibility=default -o libfoo.so -emit-interface-stubs %s 
%S/driver-test.c 2>&1 | FileCheck %s
 // CHECK: error: Interface Stub: Type Mismatch
-int foo;
\ No newline at end of file
+int foo;
Index: clang/test/InterfaceStubs/externstatic.c
===================================================================
--- clang/test/InterfaceStubs/externstatic.c
+++ clang/test/InterfaceStubs/externstatic.c
@@ -1,19 +1,19 @@
-// RUN: %clang -c -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc 
%s | \
+// RUN: %clang -fvisibility=default -c -DSTORAGE="extern" -o - 
-emit-interface-stubs -std=c99 -xc %s | \
 // RUN: FileCheck -check-prefix=CHECK-EXTERN %s
 
-// RUN: %clang -DSTORAGE="extern" -O0 -o - -c -std=c99 \
+// RUN: %clang -fvisibility=default -DSTORAGE="extern" -O0 -o - -c -std=c99 \
 // RUN: -xc %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-EXTERN %s
 
-// RUN: %clang -c -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc 
%s | \
+// RUN: %clang -fvisibility=default -c -DSTORAGE="extern" -o - 
-emit-interface-stubs -std=c99 -xc %s | \
 // RUN: FileCheck -check-prefix=CHECK-EXTERN2 %s
 
-// RUN: %clang -DSTORAGE="extern" -O0 -o - -c -std=c99 -xc %s | llvm-nm - 2>&1 
| \
+// RUN: %clang -fvisibility=default -DSTORAGE="extern" -O0 -o - -c -std=c99 
-xc %s | llvm-nm - 2>&1 | \
 // RUN: FileCheck -check-prefix=CHECK-EXTERN2 %s
 
-// RUN: %clang -c -DSTORAGE="static" -o - -emit-interface-stubs -std=c99 -xc 
%s | \
+// RUN: %clang -fvisibility=default -c -DSTORAGE="static" -o - 
-emit-interface-stubs -std=c99 -xc %s | \
 // RUN: FileCheck -check-prefix=CHECK-STATIC %s
 
-// RUN: %clang -DSTORAGE="static" -O0 -o - -c -std=c99 -xc %s | llvm-nm - 2>&1 
| \
+// RUN: %clang -fvisibility=default -DSTORAGE="static" -O0 -o - -c -std=c99 
-xc %s | llvm-nm - 2>&1 | \
 // RUN: FileCheck -check-prefix=CHECK-STATIC %s
 
 // CHECK-EXTERN-NOT: foo


Index: clang/test/InterfaceStubs/object.c
===================================================================
--- clang/test/InterfaceStubs/object.c
+++ clang/test/InterfaceStubs/object.c
@@ -1,6 +1,6 @@
-// RUN: %clang -c -o - -emit-interface-stubs %s | FileCheck -check-prefix=CHECK-TAPI %s
-// RUN: %clang -c -o - -emit-interface-stubs %s | FileCheck -check-prefix=CHECK-SYMBOLS %s
-// RUN: %clang -c -o - %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-SYMBOLS %s
+// RUN: %clang -fvisibility=default -c -o - -emit-interface-stubs %s | FileCheck -check-prefix=CHECK-TAPI %s
+// RUN: %clang -fvisibility=default -c -o - -emit-interface-stubs %s | FileCheck -check-prefix=CHECK-SYMBOLS %s
+// RUN: %clang -fvisibility=default -c -o - %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-SYMBOLS %s
 
 // CHECK-TAPI: data: { Type: Object, Size: 4 }
 // CHECK-SYMBOLS: data
Index: clang/test/InterfaceStubs/object-float.c
===================================================================
--- clang/test/InterfaceStubs/object-float.c
+++ clang/test/InterfaceStubs/object-float.c
@@ -1,3 +1,3 @@
-// RUN: not %clang -o - -emit-interface-stubs %s %S/object.c 2>&1 | FileCheck %s
+// RUN: not %clang -fvisibility=default -o - -emit-interface-stubs %s %S/object.c 2>&1 | FileCheck %s
 // CHECK: error: Interface Stub: Size Mismatch
-double data = 42.0;
\ No newline at end of file
+double data = 42.0;
Index: clang/test/InterfaceStubs/merge-conflict-test.c
===================================================================
--- clang/test/InterfaceStubs/merge-conflict-test.c
+++ clang/test/InterfaceStubs/merge-conflict-test.c
@@ -1,3 +1,3 @@
-// RUN: not %clang -o libfoo.so -emit-interface-stubs %s %S/driver-test.c 2>&1 | FileCheck %s
+// RUN: not %clang -fvisibility=default -o libfoo.so -emit-interface-stubs %s %S/driver-test.c 2>&1 | FileCheck %s
 // CHECK: error: Interface Stub: Type Mismatch
-int foo;
\ No newline at end of file
+int foo;
Index: clang/test/InterfaceStubs/externstatic.c
===================================================================
--- clang/test/InterfaceStubs/externstatic.c
+++ clang/test/InterfaceStubs/externstatic.c
@@ -1,19 +1,19 @@
-// RUN: %clang -c -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc %s | \
+// RUN: %clang -fvisibility=default -c -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc %s | \
 // RUN: FileCheck -check-prefix=CHECK-EXTERN %s
 
-// RUN: %clang -DSTORAGE="extern" -O0 -o - -c -std=c99 \
+// RUN: %clang -fvisibility=default -DSTORAGE="extern" -O0 -o - -c -std=c99 \
 // RUN: -xc %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-EXTERN %s
 
-// RUN: %clang -c -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc %s | \
+// RUN: %clang -fvisibility=default -c -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc %s | \
 // RUN: FileCheck -check-prefix=CHECK-EXTERN2 %s
 
-// RUN: %clang -DSTORAGE="extern" -O0 -o - -c -std=c99 -xc %s | llvm-nm - 2>&1 | \
+// RUN: %clang -fvisibility=default -DSTORAGE="extern" -O0 -o - -c -std=c99 -xc %s | llvm-nm - 2>&1 | \
 // RUN: FileCheck -check-prefix=CHECK-EXTERN2 %s
 
-// RUN: %clang -c -DSTORAGE="static" -o - -emit-interface-stubs -std=c99 -xc %s | \
+// RUN: %clang -fvisibility=default -c -DSTORAGE="static" -o - -emit-interface-stubs -std=c99 -xc %s | \
 // RUN: FileCheck -check-prefix=CHECK-STATIC %s
 
-// RUN: %clang -DSTORAGE="static" -O0 -o - -c -std=c99 -xc %s | llvm-nm - 2>&1 | \
+// RUN: %clang -fvisibility=default -DSTORAGE="static" -O0 -o - -c -std=c99 -xc %s | llvm-nm - 2>&1 | \
 // RUN: FileCheck -check-prefix=CHECK-STATIC %s
 
 // CHECK-EXTERN-NOT: foo
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to