================
@@ -0,0 +1,28 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
+! nonlazybind and the RtLibUseGOT module flag are applied to the LLVM module
+! after FIR is translated, so -emit-hlfir and -emit-fir cannot observe them.
+! -fno-plt marks an external procedure nonlazybind and requests GOT for
+! compiler-rt. A procedure defined in this file is left unchanged. The
+! default, and -fplt after -fno-plt, do neither.
+
+! RUN: %flang_fc1 -emit-llvm -fno-plt -o - %s | FileCheck %s
--check-prefix=NOPLT
+! RUN: %flang_fc1 -emit-llvm -o - %s | FileCheck %s --check-prefix=PLT
+! RUN: %flang_fc1 -emit-llvm -fno-plt -fplt -o - %s | FileCheck %s
--check-prefix=PLT
+
+subroutine test
+ call ext
+end subroutine
+
+! NOPLT: define void @test_()
+! NOPLT: declare void @ext_() #[[ATTR:[0-9]+]]
+! NOPLT: attributes #[[ATTR]] = { nonlazybind }
+! NOPLT: !"RtLibUseGOT"
----------------
eugeneepshteyn wrote:
The `NOPLT-NOT` for the intrinsic has to come after the `attributes #[[ATTR]]`
line, not before it. `@ext_` uses the `nonlazybind` group first, so it is
printed as `#0` and the intrinsic's group follows it. In its current place the
check only scans the one line between the `sin` declaration and `attributes
#0`, so it never sees the intrinsic's group: adding `nonlazybind` to the
`llvm.sin.f32` attributes still passes. The other new checks do catch their
defects.
https://github.com/llvm/llvm-project/pull/235622
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits