36 lines · plain
1; REQUIRES: x862; RUN: llvm-as %s -o %t.o3; RUN: ld.lld %t.o -o %t.so -shared4; RUN: llvm-readelf -S %t.so | FileCheck %s5; RUN: ld.lld %t.o -o %t.so -shared --gc-sections -z nostart-stop-gc6; RUN: llvm-readelf -S %t.so | FileCheck --check-prefix=GC %s7 8target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"9target triple = "x86_64-unknown-linux-gnu"10 11@foo = hidden global i32 42, section "foo_section"12@bar = hidden global i32 42, section "bar_section"13@zed = hidden global i32 42, section "zed_section"14 15@__start_foo_section = external global i3216@__stop_bar_section = external global i3217 18define hidden ptr @use1() {19 ret ptr @__start_foo_section20}21 22define ptr @use2() {23 ret ptr @__stop_bar_section24}25 26; CHECK-NOT: zed_section27; CHECK: foo_section PROGBITS28; CHECK-NEXT: bar_section PROGBITS29; CHECK-NOT: zed_section30 31; GC-NOT: zed_section32; GC-NOT: foo_section33; GC: bar_section PROGBITS34; GC-NOT: zed_section35; GC-NOT: foo_section36