diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-20 23:33:15 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-20 23:33:15 +0000 |
| commit | c2bb73fc8d88ba6e05ac7938385223302a2669d7 (patch) | |
| tree | 8e47947455fe004fcf92a5dc110688c3f63aefc7 /llvm/test/Transforms | |
| parent | f3878f46cecac3326a3e53db5eca7b04af995ab1 (diff) | |
| download | bcm5719-llvm-c2bb73fc8d88ba6e05ac7938385223302a2669d7.tar.gz bcm5719-llvm-c2bb73fc8d88ba6e05ac7938385223302a2669d7.zip | |
Don't crash when llvm.compiler.used becomes empty.
GlobalOpt simplifies llvm.compiler.used by removing any members that are also
in the more strict llvm.used. Handle the special case where llvm.compiler.used
becomes empty.
llvm-svn: 186778
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/GlobalOpt/compiler-used.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/GlobalOpt/compiler-used.ll b/llvm/test/Transforms/GlobalOpt/compiler-used.ll new file mode 100644 index 00000000000..a710d272edc --- /dev/null +++ b/llvm/test/Transforms/GlobalOpt/compiler-used.ll @@ -0,0 +1,16 @@ +; RUN: opt < %s -globalopt -S | FileCheck %s + +; Test that when all members of llvm.compiler.used are found to be redundant +; we delete it instead of crashing. + +define void @foo() { + ret void +} + +@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to i8*)], section "llvm.metadata" + +@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to i8*)], section "llvm.metadata" + +; CHECK-NOT: @llvm.compiler.used +; CHECK: @llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to i8*)], section "llvm.metadata" +; CHECK-NOT: @llvm.compiler.used |

