set cmd "$ld -shared -o tmpdir/indirect2.so tmpdir/indirect2.o"
check_link_message "$cmd" [list $string2] "$testname"
-set run_tests {
- {"Run with libindirect3c.so 1"
- "-Wl,--no-as-needed tmpdir/indirect3a.o tmpdir/indirect3b.o tmpdir/libindirect3c.so" ""
- {dummy.c} "indirect3a" "indirect3.out"}
- {"Run with libindirect3c.so 2"
- "-Wl,--no-as-needed tmpdir/indirect3a.o tmpdir/libindirect3c.so tmpdir/indirect3b.o" ""
- {dummy.c} "indirect3b" "indirect3.out"}
- {"Run with libindirect3c.so 3"
- "-Wl,--no-as-needed tmpdir/indirect3b.o tmpdir/libindirect3c.so tmpdir/indirect3a.o" ""
- {dummy.c} "indirect3c" "indirect3.out"}
- {"Run with libindirect3c.so 4"
- "-Wl,--no-as-needed tmpdir/libindirect3c.so tmpdir/indirect3b.o tmpdir/indirect3a.o" ""
- {dummy.c} "indirect3d" "indirect3.out"}
- {"Run with libindirect4c.so 1"
- "-Wl,--no-as-needed tmpdir/indirect4a.o tmpdir/indirect4b.o tmpdir/libindirect4c.so" ""
- {dummy.c} "indirect4a" "indirect4.out"}
- {"Run with libindirect4c.so 2"
- "-Wl,--no-as-needed tmpdir/indirect4a.o tmpdir/libindirect4c.so tmpdir/indirect4b.o" ""
- {dummy.c} "indirect4b" "indirect4.out"}
- {"Run with libindirect4c.so 3"
- "-Wl,--no-as-needed tmpdir/indirect4b.o tmpdir/libindirect4c.so tmpdir/indirect4a.o" ""
- {dummy.c} "indirect4c" "indirect4.out"}
- {"Run with libindirect4c.so 4"
- "-Wl,--no-as-needed tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" ""
- {dummy.c} "indirect4d" "indirect4.out"}
- {"Run indirect5 1"
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" ""
- {indirect5a.c} "indirect5a" "indirect5.out" "$NOPIE_CFLAGS"}
- {"Run indirect5 2"
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" ""
- {dummy.c} "indirect5b" "indirect5.out" "$NOPIE_CFLAGS"}
- {"Run indirect6 1"
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" ""
- {indirect6a.c} "indirect6a" "indirect5.out" "$NOPIE_CFLAGS"}
- {"Run indirect6 2"
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect6a.o tmpdir/libindirect5.so" ""
- {dummy.c} "indirect6b" "indirect5.out" "$NOPIE_CFLAGS"}
- {"Run with libpr18720c.so 1"
- "-Wl,--no-as-needed tmpdir/pr18720a.o tmpdir/pr18720b.o tmpdir/libpr18720c.so" ""
- {check-ptr-eq.c} "pr18720a" "pr18720.out"}
- {"Run with libpr18720c.so 2"
- "-Wl,--no-as-needed tmpdir/pr18720a.o tmpdir/libpr18720c.so tmpdir/pr18720b.o" ""
- {check-ptr-eq.c} "pr18720b" "pr18720.out"}
- {"Run with libpr18720c.so 3"
- "-Wl,--no-as-needed tmpdir/pr18720b.o tmpdir/libpr18720c.so tmpdir/pr18720a.o" ""
- {check-ptr-eq.c} "pr18720c" "pr18720.out"}
- {"Run with libpr18720c.so 4"
- "-Wl,--no-as-needed tmpdir/libpr18720c.so tmpdir/pr18720b.o tmpdir/pr18720a.o" ""
- {check-ptr-eq.c} "pr18720d" "pr18720.out"}
- {"Run with libpr18720c.so 5"
- "-Wl,--no-as-needed tmpdir/libpr18720c.so tmpdir/pr18720b1.o tmpdir/pr18720a.o" ""
- {check-ptr-eq.c} "pr18720d" "pr18720.out"}
- {"Run with libpr19553b.so"
- "-Wl,--no-as-needed tmpdir/libpr19553b.so tmpdir/libpr19553d.so -Wl,-rpath-link,." ""
- {pr19553a.c} "pr19553b" "pr19553b.out"}
- {"Run with libpr19553c.so"
- "-Wl,--no-as-needed tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" ""
- {pr19553a.c} "pr19553c" "pr19553c.out"}
- {"Run with libpr19553d.so"
- "-Wl,--no-as-needed tmpdir/libpr19553d.so tmpdir/libpr19553b.so -Wl,-rpath-link,." ""
- {pr19553a.c} "pr19553d" "pr19553d.out"}
-}
+set run_tests [list \
+ [list "Run with libindirect3c.so 1" \
+ "-Wl,--no-as-needed tmpdir/indirect3a.o tmpdir/indirect3b.o tmpdir/libindirect3c.so" "" \
+ {dummy.c} "indirect3a" "indirect3.out"] \
+ [list "Run with libindirect3c.so 2" \
+ "-Wl,--no-as-needed tmpdir/indirect3a.o tmpdir/libindirect3c.so tmpdir/indirect3b.o" "" \
+ {dummy.c} "indirect3b" "indirect3.out"] \
+ [list "Run with libindirect3c.so 3" \
+ "-Wl,--no-as-needed tmpdir/indirect3b.o tmpdir/libindirect3c.so tmpdir/indirect3a.o" "" \
+ {dummy.c} "indirect3c" "indirect3.out"] \
+ [list "Run with libindirect3c.so 4" \
+ "-Wl,--no-as-needed tmpdir/libindirect3c.so tmpdir/indirect3b.o tmpdir/indirect3a.o" "" \
+ {dummy.c} "indirect3d" "indirect3.out"] \
+ [list "Run with libindirect4c.so 1" \
+ "-Wl,--no-as-needed tmpdir/indirect4a.o tmpdir/indirect4b.o tmpdir/libindirect4c.so" "" \
+ {dummy.c} "indirect4a" "indirect4.out"] \
+ [list "Run with libindirect4c.so 2" \
+ "-Wl,--no-as-needed tmpdir/indirect4a.o tmpdir/libindirect4c.so tmpdir/indirect4b.o" "" \
+ {dummy.c} "indirect4b" "indirect4.out"] \
+ [list "Run with libindirect4c.so 3" \
+ "-Wl,--no-as-needed tmpdir/indirect4b.o tmpdir/libindirect4c.so tmpdir/indirect4a.o" "" \
+ {dummy.c} "indirect4c" "indirect4.out"] \
+ [list "Run with libindirect4c.so 4" \
+ "-Wl,--no-as-needed tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" "" \
+ {dummy.c} "indirect4d" "indirect4.out"] \
+ [list "Run indirect5 1" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" "" \
+ {indirect5a.c} "indirect5a" "indirect5.out" "$NOPIE_CFLAGS"] \
+ [list "Run indirect5 2" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" \
+ {dummy.c} "indirect5b" "indirect5.out" "$NOPIE_CFLAGS"] \
+ [list "Run indirect6 1" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" "" \
+ {indirect6a.c} "indirect6a" "indirect5.out" "$NOPIE_CFLAGS"] \
+ [list "Run indirect6 2" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect6a.o tmpdir/libindirect5.so" "" \
+ {dummy.c} "indirect6b" "indirect5.out" "$NOPIE_CFLAGS"] \
+ [list "Run with libpr18720c.so 1" \
+ "-Wl,--no-as-needed tmpdir/pr18720a.o tmpdir/pr18720b.o tmpdir/libpr18720c.so" "" \
+ {check-ptr-eq.c} "pr18720a" "pr18720.out"] \
+ [list "Run with libpr18720c.so 2" \
+ "-Wl,--no-as-needed tmpdir/pr18720a.o tmpdir/libpr18720c.so tmpdir/pr18720b.o" "" \
+ {check-ptr-eq.c} "pr18720b" "pr18720.out"] \
+ [list "Run with libpr18720c.so 3" \
+ "-Wl,--no-as-needed tmpdir/pr18720b.o tmpdir/libpr18720c.so tmpdir/pr18720a.o" "" \
+ {check-ptr-eq.c} "pr18720c" "pr18720.out"] \
+ [list "Run with libpr18720c.so 4" \
+ "-Wl,--no-as-needed tmpdir/libpr18720c.so tmpdir/pr18720b.o tmpdir/pr18720a.o" "" \
+ {check-ptr-eq.c} "pr18720d" "pr18720.out"] \
+ [list "Run with libpr18720c.so 5" \
+ "-Wl,--no-as-needed tmpdir/libpr18720c.so tmpdir/pr18720b1.o tmpdir/pr18720a.o" "" \
+ {check-ptr-eq.c} "pr18720d" "pr18720.out"] \
+ [list "Run with libpr19553b.so" \
+ "-Wl,--no-as-needed tmpdir/libpr19553b.so tmpdir/libpr19553d.so -Wl,-rpath-link,." "" \
+ {pr19553a.c} "pr19553b" "pr19553b.out"] \
+ [list "Run with libpr19553c.so" \
+ "-Wl,--no-as-needed tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" "" \
+ {pr19553a.c} "pr19553c" "pr19553c.out"] \
+ [list "Run with libpr19553d.so" \
+ "-Wl,--no-as-needed tmpdir/libpr19553d.so tmpdir/libpr19553b.so -Wl,-rpath-link,." "" \
+ {pr19553a.c} "pr19553d" "pr19553d.out"] \
+]
run_ld_link_exec_tests $run_tests