15f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall// RUN: %clang_cc1 -triple=i386-pc-solaris2.11 -w -emit-llvm %s -o - | FileCheck %s 25f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall 35f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall#pragma redefine_extname fake real 45f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall#pragma redefine_extname name alias 55f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall 65f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnallextern int fake(void); 75f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall 85f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnallint name; 95f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall 105f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall// __PRAGMA_REDEFINE_EXTNAME should be defined. This will fail if it isn't... 115f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnallint fish() { return fake() + __PRAGMA_REDEFINE_EXTNAME + name; } 125f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall// Check that the call to fake() is emitted as a call to real() 135f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall// CHECK: call i32 @real() 145f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall// Check that this also works with variables names 155f3c163b7b19a0c7e02509a0984ee1256bca890dDavid Chisnall// CHECK: load i32* @alias 16