1 // REQUIRES: x86-registered-target 2 // RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \ 3 // RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \ 4 // RUN: FileCheck -check-prefix=CHECK-TAPI %s 5 // RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \ 6 // RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \ 7 // RUN: FileCheck -check-prefix=CHECK-TAPI2 %s 8 // RUN: %clang -target x86_64-unknown-linux-gnu -o - -c %s | \ 9 // RUN: llvm-readelf -s - 2>&1 | FileCheck -check-prefix=CHECK-SYMBOLS %s 10 11 #define HIDDEN __attribute__((__visibility__(("hidden")))) 12 #define DEFAULT __attribute__((__visibility__(("default")))) 13 14 // CHECK-TAPI-NOT: _ZNK1Q5func1Ev 15 // CHECK-TAPI-NOT: _ZNK1Q5func2Ev 16 // CHECK-SYMBOLS-DAG: NOTYPE GLOBAL HIDDEN {{.*}} _ZNK1Q5func1Ev 17 // CHECK-SYMBOLS-DAG: NOTYPE GLOBAL DEFAULT {{.*}} _ZNK1Q5func2Ev 18 struct Q { 19 virtual HIDDEN int func1() const; 20 virtual DEFAULT int func2() const; 21 } q; 22 23 // CHECK-TAPI-NOT: _ZNK1S5func1Ev 24 // CHECK-TAPI2-DAG: _ZNK1S5func2Ev 25 // CHECK-SYMBOLS-DAG: FUNC WEAK HIDDEN {{.*}} _ZNK1S5func1Ev 26 // CHECK-SYMBOLS-DAG: FUNC WEAK DEFAULT {{.*}} _ZNK1S5func2Ev 27 struct S { 28 virtual HIDDEN int func1() const { return 42; } 29 virtual DEFAULT int func2() const { return 42; } 30 } s; 31 32 // CHECK-TAPI-NOT: _ZNK1R5func1Ev 33 // CHECK-TAPI-NOT: _ZNK1R5func2Ev 34 // CHECK-SYMBOLS-NOT: _ZNK1R5func1Ev 35 // CHECK-SYMBOLS-NOT: _ZNK1R5func2Ev 36 struct R { 37 virtual HIDDEN int func1() const = 0; 38 virtual DEFAULT int func2() const = 0; 39 }; 40 41 int a = q.func1() + q.func2(); 42 43