xref: /llvm-project/flang/test/Driver/underscoring.f90 (revision 4f0bea4d61b4c49f91b6502d0be7869ec2c7c1ce)
1! Test the -funderscoring flag
2
3! RUN: %flang_fc1 -S %s -o - 2>&1 | FileCheck %s --check-prefix=UNDERSCORING
4! RUN: %flang_fc1 -S -fno-underscoring %s -o - 2>&1 | FileCheck %s --check-prefix=NO-UNDERSCORING
5
6subroutine test()
7  common /comblk/ a, b
8  external :: ext_sub
9  call ext_sub()
10end
11
12! UNDERSCORING: test_
13! UNDERSCORING-NOT: {{test:$}}
14! UNDERSCORING: ext_sub_
15! UNDERSCORING-NOT: {{ext_sub[^_]*$}}
16! UNDERSCORING: comblk_
17! UNDERSCORING-NOT: comblk,
18
19! NO-UNDERSCORING-NOT: test_
20! NO-UNDERSCORING: test:
21! NO-UNDERSCORING-NOT: ext_sub_
22! NO-UNDERSCORING: {{ext_sub[^_]*$}}
23! NO-UNDERSCORING-NOT: comblk_
24! NO-UNDERSCORING: {{comblk[^_]*$}}
25