Nuno Lopes | 060ddb0 | 2012-05-09 21:21:49 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s |
Eli Friedman | 62e22ee | 2010-08-05 07:00:53 +0000 | [diff] [blame] | 2 | |
| 3 | #pragma GCC visibility push(hidden) |
| 4 | int x = 2; |
| 5 | // CHECK: @x = hidden global |
| 6 | |
| 7 | extern int y; |
| 8 | #pragma GCC visibility pop |
| 9 | int y = 4; |
| 10 | // CHECK: @y = hidden global |
| 11 | |
| 12 | #pragma GCC visibility push(hidden) |
| 13 | extern __attribute((visibility("default"))) int z; |
| 14 | int z = 0; |
| 15 | // CHECK: @z = global |
| 16 | #pragma GCC visibility pop |
| 17 | |
| 18 | #pragma GCC visibility push(hidden) |
| 19 | void f() {} |
| 20 | // CHECK: define hidden void @f |
| 21 | |
| 22 | __attribute((visibility("default"))) void g(); |
| 23 | void g() {} |
| 24 | // CHECK: define void @g |