2020-01-19 01:54:35 +08:00
|
|
|
// REQUIRES: x86-registered-target
|
2019-11-14 12:58:09 +08:00
|
|
|
// RUN: %clang -cc1 -fvisibility default -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc %s | \
|
2019-06-21 00:59:48 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-EXTERN %s
|
2019-10-08 23:23:14 +08:00
|
|
|
|
2020-01-18 02:30:54 +08:00
|
|
|
// RUN: %clang -cc1 -triple x86_64 -fvisibility default -DSTORAGE=extern -O0 -o - -emit-obj -std=c99 \
|
|
|
|
// RUN: %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-EXTERN %s
|
2019-06-21 00:59:48 +08:00
|
|
|
|
2019-11-14 12:58:09 +08:00
|
|
|
// RUN: %clang -cc1 -fvisibility default -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc %s | \
|
2019-10-08 23:23:14 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-EXTERN2 %s
|
|
|
|
|
2020-01-18 02:30:54 +08:00
|
|
|
// RUN: %clang -cc1 -triple x86_64 -fvisibility default -DSTORAGE=extern -O0 -o - -emit-obj -std=c99 \
|
|
|
|
// RUN: %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-EXTERN2 %s
|
2019-06-21 00:59:48 +08:00
|
|
|
|
2019-11-14 12:58:09 +08:00
|
|
|
// RUN: %clang -cc1 -fvisibility default -DSTORAGE="static" -o - -emit-interface-stubs -std=c99 -xc %s | \
|
2019-10-08 23:23:14 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-STATIC %s
|
|
|
|
|
2020-01-18 02:30:54 +08:00
|
|
|
// RUN: %clang -cc1 -triple x86_64 -fvisibility default -DSTORAGE=static -O0 -o - -emit-obj -std=c99 \
|
|
|
|
// RUN: %s | llvm-nm - 2>&1 | count 0
|
2019-06-21 00:59:48 +08:00
|
|
|
|
|
|
|
// CHECK-EXTERN-NOT: foo
|
|
|
|
// CHECK-STATIC-NOT: foo
|
|
|
|
// CHECK-STATIC-NOT: bar
|
|
|
|
|
|
|
|
// We want to emit extern function symbols.
|
|
|
|
// CHECK-EXTERN2: bar
|
|
|
|
STORAGE int foo;
|
|
|
|
STORAGE int bar() { return 42; }
|