File: aix-ignore-xcoff-visibility.cpp

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (73 lines) | stat: -rw-r--r-- 2,894 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// RUN: %clang_cc1 -no-opaque-pointers -triple powerpc-unknown-aix -emit-llvm -o - -x c++ %s  | \
// RUN: FileCheck -check-prefix=VISIBILITY-IR %s

// RUN: %clang_cc1 -no-opaque-pointers -triple powerpc-unknown-aix -emit-llvm -round-trip-args -o - -x c++ %s  | \
// RUN: FileCheck -check-prefix=VISIBILITY-IR %s

// RUN: %clang_cc1 -no-opaque-pointers -triple powerpc-unknown-aix -mignore-xcoff-visibility -fvisibility default -emit-llvm -o - -x c++ %s  | \
// RUN: FileCheck -check-prefix=NOVISIBILITY-IR %s

// RUN: %clang_cc1 -no-opaque-pointers -triple powerpc-unknown-aix -mignore-xcoff-visibility -fvisibility default -emit-llvm -round-trip-args -o - -x c++ %s  | \
// RUN: FileCheck -check-prefix=NOVISIBILITY-IR %s

// RUN: %clang_cc1 -no-opaque-pointers -triple powerpc-unknown-aix -fvisibility default -emit-llvm -o - -x c++ %s  | \
// RUN: FileCheck -check-prefix=VISIBILITY-IR %s

// RUN: %clang_cc1 -no-opaque-pointers -triple powerpc-unknown-aix -fvisibility default -round-trip-args -emit-llvm -o - -x c++ %s  | \
// RUN: FileCheck -check-prefix=VISIBILITY-IR %s

__attribute__((visibility("hidden"))) void foo_h(int *p) {
  (*p)++;
}

__attribute__((visibility("protected"))) int b;

extern __attribute__((visibility("hidden"))) void zoo_extern_h(void);

void (*foo_p)(void) = zoo_extern_h;

__attribute__((visibility("protected"))) void bar() {
  foo_h(&b);
  foo_p();
}

class TestClass {
public:
  __attribute__((__visibility__("hidden"))) int value() const noexcept { return 0; }
};

int main() {
  TestClass TC;
  return TC.value();
}

template <class T>
class basic {
public:
  __attribute__((__visibility__("protected"))) int getdata() { return 1; }
};

template class basic<int>;

#pragma GCC visibility push(hidden)
int pramb;
void prambar() {}
#pragma GCC visibility pop

// VISIBILITY-IR:    @b = protected global i32 0
// VISIBILITY-IR:    @pramb = hidden global i32 0
// VISIBILITY-IR:    define hidden void @_Z5foo_hPi(i32* noundef %p)
// VISIBILITY-IR:    declare hidden void @_Z12zoo_extern_hv()
// VISIBILITY-IR:    define protected void @_Z3barv()
// VISIBILITY-IR:    define linkonce_odr hidden noundef i32 @_ZNK9TestClass5valueEv(%class.TestClass* {{[^,]*}} %this)
// VISIBILITY-IR:    define weak_odr protected noundef i32 @_ZN5basicIiE7getdataEv(%class.basic* {{[^,]*}} %this)
// VISIBILITY-IR:    define hidden void @_Z7prambarv()

// NOVISIBILITY-IR:    @b = global i32 0
// NOVISIBILITY-IR:    @pramb = global i32 0
// NOVISIBILITY-IR:    define void @_Z5foo_hPi(i32* noundef %p)
// NOVISIBILITY-IR:    declare void @_Z12zoo_extern_hv()
// NOVISIBILITY-IR:    define void @_Z3barv()
// NOVISIBILITY-IR:    define linkonce_odr noundef i32 @_ZNK9TestClass5valueEv(%class.TestClass* {{[^,]*}} %this)
// NOVISIBILITY-IR:    define weak_odr noundef i32 @_ZN5basicIiE7getdataEv(%class.basic* {{[^,]*}} %this)
// NOVISIBILITY-IR:    define void @_Z7prambarv()