[Reland][Runtimes] Merge 'compile_commands.json' files from runtimes build (#116303)
[llvm-project.git] / clang / test / InterfaceStubs / visibility.cpp
blobc87872e25b4fdd88750d5e56915d6397cc5cd667
1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
3 // RUN: -fvisibility=hidden %s | FileCheck --check-prefix=CHECK-CMD-HIDDEN %s
5 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
6 // RUN: -fvisibility=hidden %s | FileCheck --check-prefix=CHECK-CMD-HIDDEN %s
8 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
9 // RUN: FileCheck --check-prefix=CHECK-CMD %s
11 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
12 // RUN: FileCheck --check-prefix=CHECK-CMD %s
14 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
15 // RUN: FileCheck --check-prefix=CHECK-CMD2 %s
17 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
18 // RUN: FileCheck --check-prefix=CHECK-CMD2 %s
20 // RUN: %clang -target x86_64-unknown-linux-gnu -o - -c %s | llvm-readelf -s - 2>&1 | \
21 // RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s
23 // Always Be Hidden:
24 // CHECK-CMD-HIDDEN-NOT: _Z6hiddenv
25 // CHECK-CMD2-NOT: _Z6hiddenv
26 __attribute__((visibility("hidden"))) void hidden() {}
28 // Always Be Visible:
29 // CHECK-CMD-HIDDEN: _Z9nothiddenv
30 // CHECK-CMD-DAG: _Z9nothiddenv
31 __attribute__((visibility("default"))) void nothidden() {}
33 // Do Whatever -fvisibility says:
34 // CHECK-CMD-HIDDEN-NOT: _Z10cmdVisiblev
35 // CHECK-CMD-DAG: _Z10cmdVisiblev
36 void cmdVisible() {}
38 // CHECK-SYMBOLS-DAG: DEFAULT {{.*}} _Z10cmdVisiblev
39 // CHECK-SYMBOLS-DAG: HIDDEN {{.*}} _Z6hiddenv
40 // CHECK-SYMBOLS-DAG: DEFAULT {{.*}} _Z9nothiddenv