view gcc/testsuite/g++.dg/ext/asmspecInvalid.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// tests that the asm directive is correctly handled for static fields
// in structures and classes.  This only applies to C++; such
// directives generate errors in C.  Assembler directives for local
// variables should be tested by the C test suite.  
//
// Contributed by Robert Bowdidge (bowdidge@apple.com) 14 Oct 2003

// { dg-do compile }

struct Foo {
  // This should reference a variable called bar
  int i __asm__("bar");  /* { dg-error "specifiers are not permitted" } */
};

int main (void ) {
  int j = 0;
  return j;
}