xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/redefine_extname.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple=i386-pc-solaris2.11 -w -emit-llvm %s -o - | FileCheck %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc #pragma redefine_extname fake real
4*f4a2713aSLionel Sambuc #pragma redefine_extname name alias
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc extern int fake(void);
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc int name;
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc // __PRAGMA_REDEFINE_EXTNAME should be defined.  This will fail if it isn't...
fish()11*f4a2713aSLionel Sambuc int fish() { return fake() + __PRAGMA_REDEFINE_EXTNAME + name; }
12*f4a2713aSLionel Sambuc // Check that the call to fake() is emitted as a call to real()
13*f4a2713aSLionel Sambuc // CHECK:   call i32 @real()
14*f4a2713aSLionel Sambuc // Check that this also works with variables names
15*f4a2713aSLionel Sambuc // CHECK:   load i32* @alias
16