[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Runtime / no-cpp-dep.c
blobf8fe97b5bf78e247b50780910cd819c94deeefd0
1 /*
2 This test makes sure that flang's runtime does not depend on the C++ runtime
3 library. It tries to link this simple file against libFortranRuntime.a with
4 a C compiler.
6 REQUIRES: c-compiler
8 RUN: %cc -std=c99 %s -I%include %libruntime %libdecimal -lm -o /dev/null
9 */
11 #include "flang/Runtime/entry-names.h"
12 #include <stdint.h>
15 Manually add declarations for the runtime functions that we want to make sure
16 we're testing. We can't include any headers directly since they likely contain
17 C++ code that would explode here.
19 struct EnvironmentDefaultList;
20 struct Descriptor;
22 double RTNAME(CpuTime)();
24 void RTNAME(ProgramStart)(
25 int, const char *[], const char *[], const struct EnvironmentDefaultList *);
26 int32_t RTNAME(ArgumentCount)();
27 int32_t RTNAME(GetCommandArgument)(int32_t, const struct Descriptor *,
28 const struct Descriptor *, const struct Descriptor *);
29 int32_t RTNAME(GetEnvVariable)();
31 int main() {
32 double x = RTNAME(CpuTime)();
33 RTNAME(ProgramStart)(0, 0, 0, 0);
34 int32_t c = RTNAME(ArgumentCount)();
35 int32_t v = RTNAME(GetCommandArgument)(0, 0, 0, 0);
36 int32_t e = RTNAME(GetEnvVariable)("FOO", 0, 0);
37 return x + c + v + e;