diff options
Diffstat (limited to 'test/CodeGen/addrsig.c')
-rw-r--r-- | test/CodeGen/addrsig.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/addrsig.c b/test/CodeGen/addrsig.c new file mode 100644 index 000000000000..d7141092bb35 --- /dev/null +++ b/test/CodeGen/addrsig.c @@ -0,0 +1,20 @@ +// REQUIRES: x86-registered-target + +// RUN: %clang_cc1 -triple=x86_64-unknown-linux -S %s -faddrsig -O -o - | FileCheck --check-prefix=ADDRSIG %s +// RUN: %clang_cc1 -triple=x86_64-unknown-linux -S %s -O -o - | FileCheck --check-prefix=NO-ADDRSIG %s + +// ADDRSIG: .addrsig +// ADDRSIG: .addrsig_sym g1 +// ADDRSIG-NOT: .addrsig_sym g2 + +// NO-ADDRSIG-NOT: .addrsig + +extern const int g1[], g2[]; + +const int *f1() { + return g1; +} + +int f2() { + return g2[0]; +} |