2019-10-03 10:38:43 +08:00
|
|
|
// REQUIRES: x86-registered-target
|
|
|
|
// RUN: %clang -DSTORAGE="extern" -target x86_64-unknown-linux-gnu -o - \
|
|
|
|
// RUN: -emit-interface-stubs \
|
|
|
|
// RUN: -interface-stub-version=experimental-ifs-v1 -std=c99 -xc %s | \
|
2019-06-21 00:59:48 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-EXTERN %s
|
2019-10-03 10:38:43 +08:00
|
|
|
// RUN: %clang -DSTORAGE="extern" -target x86_64-linux-gnu -O0 -o - -c -std=c99 \
|
2019-06-21 00:59:48 +08:00
|
|
|
// RUN: -xc %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-EXTERN %s
|
|
|
|
|
2019-10-03 10:38:43 +08:00
|
|
|
// RUN: %clang -DSTORAGE="extern" -target x86_64-unknown-linux-gnu -o - \
|
|
|
|
// RUN: -emit-interface-stubs \
|
|
|
|
// RUN: -interface-stub-version=experimental-ifs-v1 -std=c99 -xc %s | \
|
2019-06-21 00:59:48 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-EXTERN2 %s
|
2019-10-03 10:38:43 +08:00
|
|
|
// RUN: %clang -DSTORAGE="extern" -target x86_64-linux-gnu -O0 -o - -c -std=c99 \
|
|
|
|
// RUN: -xc %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-EXTERN2 %s
|
2019-06-21 00:59:48 +08:00
|
|
|
|
2019-10-03 10:38:43 +08:00
|
|
|
// RUN: %clang -DSTORAGE="static" -target x86_64-unknown-linux-gnu -o - \
|
|
|
|
// RUN: -emit-interface-stubs \
|
|
|
|
// RUN: -interface-stub-version=experimental-ifs-v1 -std=c99 -xc %s | \
|
2019-06-21 00:59:48 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-STATIC %s
|
2019-10-03 10:38:43 +08:00
|
|
|
// RUN: %clang -DSTORAGE="static" -target x86_64-linux-gnu -O0 -o - -c -std=c99 \
|
|
|
|
// RUN: -xc %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-STATIC %s
|
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; }
|