Michał Górny 1609a5d771 [clang] [test] Use %clang_cc1 substitution consistently
Use the `%clang_cc1` substitution consistently across the test suite,
replacing inline `%clang -cc1` invocations, except for one Preprocessor
test where this is causing breakage.  This is necessary to ensure that
additional parameters passed via `%clang` do not interfere with `-cc1`
that must always be passed as the first command-line argument.

Remove the additional substitution blocking `%clang_cc1` use in Driver
tests.  It has been added in 2013 and was supposed to prevent tests
calling `clang -cc1` from being added to Driver.  The state of the test
suite proves that it did not succeed at all.

Differential Revision: https://reviews.llvm.org/D134880
2022-09-29 20:59:00 +02:00

28 lines
1.2 KiB
C

// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -fvisibility=default -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-EXTERN %s
// 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
// RUN: %clang_cc1 -fvisibility=default -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-EXTERN2 %s
// 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
// RUN: %clang_cc1 -fvisibility=default -DSTORAGE="static" -o - -emit-interface-stubs -std=c99 -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-STATIC %s
// RUN: %clang_cc1 -triple x86_64 -fvisibility=default -DSTORAGE=static -O0 -o - -emit-obj -std=c99 \
// RUN: %s | llvm-nm - 2>&1 | count 0
// 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(void) { return 42; }