Skip to content

[WIP] Fix incorrect LLVM Linkage enum #33994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/librustc_llvm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ pub enum Linkage {
AvailableExternallyLinkage = 1,
LinkOnceAnyLinkage = 2,
LinkOnceODRLinkage = 3,
WeakAnyLinkage = 5,
WeakODRLinkage = 6,
AppendingLinkage = 7,
InternalLinkage = 8,
PrivateLinkage = 9,
ExternalWeakLinkage = 12,
CommonLinkage = 14,
WeakAnyLinkage = 4,
WeakODRLinkage = 5,
AppendingLinkage = 6,
InternalLinkage = 7,
PrivateLinkage = 8,
ExternalWeakLinkage = 9,
CommonLinkage = 10,
}

#[repr(C)]
Expand Down
49 changes: 49 additions & 0 deletions src/test/run-pass/issue-33992.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-windows
// ignore-macos

#![feature(linkage)]

#[linkage = "appending"]
pub static TEST1: bool = true;

#[linkage = "available_externally"]
pub static TEST2: bool = true;

#[linkage = "common"]
pub static TEST3: bool = true;

#[linkage = "extern_weak"]
pub static TEST4: bool = true;

#[linkage = "external"]
pub static TEST5: bool = true;

#[linkage = "internal"]
pub static TEST6: bool = true;

#[linkage = "linkonce"]
pub static TEST7: bool = true;

#[linkage = "linkonce_odr"]
pub static TEST8: bool = true;

#[linkage = "private"]
pub static TEST9: bool = true;

#[linkage = "weak"]
pub static TEST10: bool = true;

#[linkage = "weak_odr"]
pub static TEST11: bool = true;

fn main() {}